man execve / Suggestion

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

 



I would like to suggest an improvement on the execve man-page (Page
Version 3.27). In the description of the execve system call I would
suggest to add a reminder that the argv arrays need to have put the
programm name as its first argument.

For the unexperienced it is easy to write something as such:

char* program = "/usr/bin/ls";
char* file = "-lah";
char* argv[] = {file, NULL}; //should be {program, file, NULL}
char* envp[] = {NULL};
execve(eog, argv, envp);

For the experienced programmers this is probably obvious, yet for those
more unexperienced it would be a useful hint if the man-page said
something like:

"Remember the first argument in the argv array should be the path to the
programm that is about to be executed and your custom arguments should
start from the second position."

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


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux