Commit Graph

9172 Commits

Author SHA1 Message Date
Peter LaDow 0c42642f86 execve: Add envp to the Linux notes about NULL pointers
During the review of static analysis results, we discovered a
functional, but non-portable, use of execve().  For example:

    char *cmd[] = { "/path/to/some/file", NULL };
    execve(cmd[0], cmd, NULL);

The call succeeds.  Yet, the static analysis tool (rightly)
pointed out that envp could be dereferenced.  But digging into
glibc and the kernel, it appears that like argv, envp when NULL
is treated as if it were an empty list.

So, to clear things up, I'm submitting this patch to update the
man page to indicate that envp is treated like argv.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-21 14:21:43 +02:00
Michael Kerrisk f9293d9857 io_setup.2, perf_event_open.2, readdir.2, syscall.2, a64l.3, abs.3, asprintf.3, bindresvport.3, catgets.3, ceil.3, cimag.3, conj.3, crypt.3, drand48.3, encrypt.3, ether_aton.3, fcloseall.3, ferror.3, fmtmsg.3, getdate.3, getgrent.3, getgrnam.3, getpass.3, getpwent.3, getpwnam.3, getttyent.3, getusershell.3, localeconv.3, mblen.3, mbrlen.3, mbrtowc.3, modf.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_setname_np.3, ptsname.3, qecvt.3, re_comp.3, readdir.3, rexec.3, round.3, scalbln.3, stdio_ext.3, strerror.3, tmpnam.3, trunc.3, ttyname.3, ttyslot.3, inotify.7, man-pages.7, socket.7, tcp.7, udp.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-21 13:35:03 +02:00
Michael Kerrisk 2857d3ff8a pread.2: pread() and pwrite() are especially useful in multithreaded applications
Reported-by: Марк Коренберг <socketpair@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-21 12:30:25 +02:00
Michael Kerrisk 04aa92829d argz_add.3: ffix
Reported-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-21 00:06:56 +02:00
Michael Kerrisk dcf163b97b envz_add.3: ffix
Reported-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-21 00:02:24 +02:00
Eric S. Raymond 9b1c7a292f regex.3: Remove unused macro
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-20 23:59:18 +02:00
Michael Kerrisk 474446468e basename.3: Fix errors from Eric Raymond's previous commit
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-20 23:47:42 +02:00
Eric S. Raymond c6076d0e53 basename.3: Replace an ad-hoc table with a real one
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-20 23:43:32 +02:00
Eric S. Raymond 4df3a4bc62 console_codes.4: Replace some .in uses with equivalent .RS/.RE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-20 23:40:13 +02:00
Peng Haitao de541d4b88 mblen.3: ATTRIBUTES: Note function that is not thread-safe
The function mblen() is not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-06-20 23:36:52 +02:00
Peng Haitao 5621da57fa conj.3: ATTRIBUTES: Note functions that are thread-safe
The functions conj(), conjf() and conjl() are thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-06-20 23:36:52 +02:00
Peng Haitao 6d74e86185 scalbln.3: ATTRIBUTES: Note functions that are thread-safe
The functions scalbn(), scalbnf(), scalbnl(), scalbln(),
scalblnf() and scalblnl() are thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-06-20 23:36:52 +02:00
Michael Kerrisk 8f0d86a3d5 Merge branch 'master' of ra.kernel.org:/pub/scm/docs/man-pages/man-pages 2013-06-19 10:19:41 +02:00
Peng Haitao 18b3fa616f strerror.3: ATTRIBUTES: Note function that is not thread-safe
The function strerror() is not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-06-19 03:34:44 +02:00
Peng Haitao e3543fbba9 cimag.3: ATTRIBUTES: Note functions that are thread-safe
The functions cimag(), cimagf() and cimagl() are thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-06-19 03:34:44 +02:00
Peng Haitao 907036968e modf.3: ATTRIBUTES: Note functions that are thread-safe
The functions modf(), modff() and modfl() are thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-06-19 03:34:44 +02:00
Peng Haitao d265b8f2fc trunc.3: ATTRIBUTES: Note functions that are thread-safe
The functions trunc(), truncf() and truncl() are thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-06-19 03:34:44 +02:00
Peng Haitao ed21d74901 ceil.3, round.3: ATTRIBUTES: tfix
Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-06-19 03:34:44 +02:00
Peng Haitao 7836c64d88 round.3: ATTRIBUTES: Note functions that are thread-safe
The functions round(), roundf() and roundl() are thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-06-19 03:34:44 +02:00
Peng Haitao ea32445bea ceil.3: ATTRIBUTES: Note functions that are thread-safe
The functions ceil(), ceilf() and ceill() are thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
2013-06-19 03:34:44 +02:00
Peng Haitao 1ad7b08940 mbrtowc.3: ATTRIBUTES: Note function that is thread safe with exceptions
The function mbrtowc() is thread safe with exceptions.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:34:44 +02:00
Peng Haitao 3220895675 strtok.3: ATTRIBUTES: Note function that is not thread-safe
The function strtok() is not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:33 +02:00
Peng Haitao b6c6e0a33d abs.3: ATTRIBUTES: Note functions that are thread-safe
The functions abs(), labs(), llabs() and imaxabs() are
thread-safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:33 +02:00
Michael Kerrisk 8ee22ae82c ferror.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:33 +02:00
Peng Haitao 82e25934ab ferror.3: ATTRIBUTES: Note functions that are thread-safe
The functions ferror(), clearerr(), feof() and fileno() are
thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:33 +02:00
Peng Haitao 70f5f10ecb tmpnam.3: ATTRIBUTES: Note function that is thread safe with exceptions
The function tmpnam() is thread safe with exceptions.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:33 +02:00
Michael Kerrisk 7ec74538de mbrlen.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:33 +02:00
Peng Haitao 6c2ec40d25 mbrlen.3: ATTRIBUTES: Note function that is thread safe with exceptions
The function mbrlen() is thread safe with exceptions.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:33 +02:00
Peng Haitao 7c51f0e341 getusershell.3: ATTRIBUTES: Note functions that are not thread-safe
The functions getusershell(), setusershell() and endusershell()
are not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:02 +02:00
Peng Haitao 6a92c34cff ether_aton.3: ATTRIBUTES: Note functions that are not thread-safe
The functions ether_aton() and ether_ntoa() are not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:02 +02:00
Michael Kerrisk 3f69da2862 getgrent.3, getlogin.3, getpwent.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:02 +02:00
Michael Kerrisk b6cab55bd6 a64l.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:02 +02:00
Peng Haitao 1454246e94 getlogin.3: ATTRIBUTES: Note function that is not thread-safe
The function getlogin() is not thread safe.
The function cuserid() is thread-safe with exceptions.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:02 +02:00
Peng Haitao d506211293 rexec.3: ATTRIBUTES: Note functions that are not thread-safe
The functions rexec() and rexec_af() are not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:02 +02:00
Peng Haitao cbdd5ebe6e stdio_ext.3: ATTRIBUTES: Note functions that are not thread-safe
The functions __fbufsize(), __fpending(), __fpurge() and
__fsetlocking() are not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:02 +02:00
Peng Haitao dc01ee8742 re_comp.3: ATTRIBUTES: Note functions that are not thread-safe
The functions re_comp() and re_exec() are not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:02 +02:00
Michael Kerrisk 974afcfe41 drand48.3: Minor rewording
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:02 +02:00
Peng Haitao ba3680650c drand48.3: ATTRIBUTES: Note functions that are not thread-safe
The functions drand48(), erand48(), lrand48(), nrand48(),
mrand48(), jrand48(), srand48(), seed48() and lcong48() are
not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:31:02 +02:00
Peng Haitao 20d546abd5 a64l.3: ATTRIBUTES: Note function that is not thread-safe
The function l64a() is not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:30:25 +02:00
Peng Haitao 9ed071a41b bindresvport.3: ATTRIBUTES: Note function that is thread-safe
Before glibc 2.17, bindresvport() is not thread-safe.
Since glibc 2.17, it is thread-safe, the patch can refer to URL:
http://sourceware.org/git/?p=glibc.git;a=commit;h=f6da27e53695ad1cc0e2a9490358decbbfdff5e5

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com
2013-06-19 03:30:24 +02:00
Peng Haitao 93a8236f6e fmtmsg.3: ATTRIBUTES: Note function that is thread-safe
Before glibc 2.16, fmtmsg() is not thread-safe.
Since glibc 2.16, it is thread-safe, the patch can refer to URL:
http://sourceware.org/git/?p=glibc.git;a=commit;h=7724defcf8873116fe4efab256596861eef21a94

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com
2013-06-19 03:30:24 +02:00
Peng Haitao 7231e4c37a getgrent.3: ATTRIBUTES: Note function that is not thread-safe
The function getgrent() is not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com
2013-06-19 03:30:24 +02:00
Peng Haitao 8bce342494 getpwent.3: ATTRIBUTES: Note function that is not thread-safe
The function getpwent() is not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com
2013-06-19 03:30:24 +02:00
Peng Haitao dee90154c7 crypt.3: ATTRIBUTES: Note function that is not thread-safe
The function crypt() is not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com
2013-06-19 03:30:24 +02:00
Peng Haitao 4fc2f6479b encrypt.3: ATTRIBUTES: Note functions that are not thread-safe
The functions encrypt() and setkey() are not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com
2013-06-19 03:30:24 +02:00
Peng Haitao 1d94efa5ad ptsname.3: ATTRIBUTES: Note function that is not thread-safe
The function ptsname() is not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com
2013-06-19 03:30:24 +02:00
Peng Haitao f4d7c22be6 fcloseall.3: ATTRIBUTES: Note function that is not thread-safe
The function fcloseall() is not thread safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com
2013-06-19 03:30:24 +02:00
Peng Haitao e92d82ff95 hsearch.3: ATTRIBUTES: Note functions that are not thread-safe
The functions hsearch(), hcreate() and hdestroy() are not
thread-safe.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:30:24 +02:00
Peng Haitao 8744c6c21d qecvt.3: ATTRIBUTES: Note functions that are not thread-safe
The functions qecvt() and qfcvt() are not thread-safe.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com
2013-06-19 03:30:24 +02:00
Michael Kerrisk be05dcc7d5 ttyslot.3: ATTRIBUTES: Note functions that are not thread-safe
Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-06-19 03:30:24 +02:00