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