Re: execv fails with EFAULT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 07, 2007 at 05:24:32PM +0530, Prasanta Sadhukhan wrote:
>    if(execv("/bin/ls", "-l") == -1)
>
hi

from man execv:

int execv(const char *path, char *const argv[]);

see the second argument here is an array of strings, not a string

so you cant just pass a string, you need to pass an array of pointers and it must be terminated by a NULL pointer

-M
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux