1 /* Test of execv(). 2 Copyright (C) 2020-2021 Free Software Foundation, Inc. 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 3, or (at your option) 7 any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, see <https://www.gnu.org/licenses/>. */ 16 17 /* Written by Bruno Haible <bruno@clisp.org>, 2020. */ 18 19 #include <config.h> 20 21 /* Specification. */ 22 #include <unistd.h> 23 24 #include "signature.h" 25 SIGNATURE_CHECK (execv, int, (const char *, char * const *)); 26 27 #include <stdio.h> 28 29 int 30 main () /* */ 31 { 32 const char *progname = "./test-exec-child"; 33 const char *argv[12] = 34 { 35 progname, 36 "abc def", 37 "abc\"def\"ghi", 38 "xyz\"", 39 "abc\\def\\ghi", 40 "xyz\\", 41 "???", 42 "***", 43 "", 44 "foo", 45 "", 46 NULL 47 }; 48 execv (progname, (char * const *) argv); 49 50 perror ("execv"); 51 return 1; 52 }