argv[0] in execvp()

From: Alex Vinokur (alexvn_at_users.sourceforge.net)
Date: 11/26/05


Date: 25 Nov 2005 21:30:18 -0800


QUOTES from http://www.mkssoftware.com/docs/man3/execl.3.asp

----------------------------------------------------
int execvp(const char *file, char *const argv[])

argv
Is the argument list for the new process image. This should contain an
array of pointers to character strings, and the array should be
terminated by a NULL pointer. The value in argv[0] should point to a
file name that is associated with the process being started by the
exec() function.
-----------------------------------------------------

Why should 'argv[0]' point to a file name?
Is not it enough the 'file' parameter to execute the program?

Alex Vinokur
     email: alex DOT vinokur AT gmail DOT com
     http://mathforum.org/library/view/10978.html
     http://sourceforge.net/users/alexvn



Relevant Pages

  • Re: argv[0] in execvp()
    ... > Is the argument list for the new process image. ... > array of pointers to character strings, ... but the argv[] parameter is used by the linker to pass information ...
    (comp.unix.programmer)
  • Re: walking through an array of char pointers
    ... > and argv, argv which is an array of char pointers, ... but not to a locally declared array of pointers. ...
    (comp.lang.c)
  • Re: about argc and argv
    ... argv is an array of character strings. ... pointers point to the beginnings of character strings. ...
    (comp.lang.c)
  • Re: about argc and argv
    ... argv is an array of character strings. ... argv is an array of pointers, ... pointers point to the beginnings of character strings. ...
    (comp.lang.c)
  • Re: about argc and argv
    ... argv is an array of pointers, ... pointers point to the beginnings of character strings. ...
    (comp.lang.c)