| Bjorn Reese 2004-05-18, 2:50 pm |
| On Tue, 18 May 2004 10:21:50 +0200, Christoph Bartoschek wrote:
> execve() however takes a "char *const argv []" for the argument list. Is
> there a reason that it does not take a "char const * const argv[]" similar
> to execl()?
From SUSv3 [1]
"The statement about argv[] and envp[] being constants is
included to make explicit to future writers of language
bindings that these objects are completely constant. Due to
a limitation of the ISO C standard, it is not possible to
state that idea in standard C. Specifying two levels of const-
qualification for the argv[] and envp[] parameters for the
exec functions may seem to be the natural choice, given that
these functions do not modify either the array of pointers
or the characters to which the function points, but this
would disallow existing correct code. Instead, only the
array of pointers is noted as constant."
[1] http://www.opengroup.org/onlinepubs...tions/exec.html
--
mail1dotstofanetdotdk
|