From 456960740c5b50c3a6a1c9539fd4d8851e2eb885 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 30 Apr 2007 10:39:32 +0000 Subject: [PATCH] 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. --- man2/execve.2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/man2/execve.2 b/man2/execve.2 index af5fd1585..739cf761c 100644 --- a/man2/execve.2 +++ b/man2/execve.2 @@ -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