Add text noting that Linux allows 'argv' and 'envp' to be

NULL, but warning that this is non-standard and non-portable,
and should be avoided in portable programs.
Bug filed (http://bugzilla.kernel.org/show_bug.cgi?id=8408)
to get this changed, but maybe that won't be done because it
is an ABI change.
This commit is contained in:
Michael Kerrisk 2007-04-30 10:39:32 +00:00
parent cd24c68794
commit 456960740c
1 changed files with 17 additions and 0 deletions

View File

@ -324,6 +324,23 @@ successfully.
A maximum line length of 127 characters is allowed for the first line in
a #! executable shell script.
On Linux,
.I argv
and
.I envp
can be specified as NULL,
which has the same effect has specifying these arguments
as pointers to lists containing a single NULL pointer.
.BR "Do not take advantage of this feature!"
It is non-standard and non-portable:
on most other Unix systems doing this will result in an error.
.\" e.g. EFAULT on Solaris 8 and FreeBSD 6.1; but
.\" HP-UX 11 is like Linux -- mtk, Apr 2007
.\" FIXME .
.\" Bug filed 30 Apr 2007: http://bugzilla.kernel.org/show_bug.cgi?id=8408
.\" Maybe this will get fixed (but it would coinstitute an ABI change).
.\"
.\" .SH BUGS
.\" Some Linux versions have failed to check permissions on ELF
.\" interpreters. This is a security hole, because it allows users to