1f08c3bdfSopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
2f08c3bdfSopenharmony_ci/*
3f08c3bdfSopenharmony_ci * Copyright (c) 2018 Linux Test Project
4f08c3bdfSopenharmony_ci * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
5f08c3bdfSopenharmony_ci * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
6f08c3bdfSopenharmony_ci *    AUTHOR		: William Roske
7f08c3bdfSopenharmony_ci *    CO-PILOT		: Dave Fenner
8f08c3bdfSopenharmony_ci */
9f08c3bdfSopenharmony_ci
10f08c3bdfSopenharmony_ci#include <errno.h>
11f08c3bdfSopenharmony_ci#include <string.h>
12f08c3bdfSopenharmony_ci#include <signal.h>
13f08c3bdfSopenharmony_ci#include <stdlib.h>
14f08c3bdfSopenharmony_ci
15f08c3bdfSopenharmony_ci#include <sys/types.h>
16f08c3bdfSopenharmony_ci#include <sys/wait.h>
17f08c3bdfSopenharmony_ci
18f08c3bdfSopenharmony_ci#include "tst_test.h"
19f08c3bdfSopenharmony_ci
20f08c3bdfSopenharmony_cistatic void verify_execlp(void)
21f08c3bdfSopenharmony_ci{
22f08c3bdfSopenharmony_ci	pid_t pid;
23f08c3bdfSopenharmony_ci
24f08c3bdfSopenharmony_ci	pid = SAFE_FORK();
25f08c3bdfSopenharmony_ci	if (pid == 0) {
26f08c3bdfSopenharmony_ci		TEST(execlp("execlp01_child", "execlp01_child", "canary", NULL));
27f08c3bdfSopenharmony_ci		tst_brk(TFAIL | TTERRNO,
28f08c3bdfSopenharmony_ci			"Failed to execute execlp01_child");
29f08c3bdfSopenharmony_ci	}
30f08c3bdfSopenharmony_ci}
31f08c3bdfSopenharmony_ci
32f08c3bdfSopenharmony_cistatic struct tst_test test = {
33f08c3bdfSopenharmony_ci	.forks_child = 1,
34f08c3bdfSopenharmony_ci	.child_needs_reinit = 1,
35f08c3bdfSopenharmony_ci	.test_all = verify_execlp,
36f08c3bdfSopenharmony_ci};
37