]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
8 years agoReady for 4.04 man-pages-4.04
Michael Kerrisk [Tue, 29 Dec 2015 12:51:39 +0000 (13:51 +0100)] 
Ready for 4.04

8 years agoRemoved trailing white space at end of lines
Michael Kerrisk [Tue, 29 Dec 2015 12:51:32 +0000 (13:51 +0100)] 
Removed trailing white space at end of lines

8 years agoclock_getres.2: ffix
Michael Kerrisk [Tue, 29 Dec 2015 12:50:26 +0000 (13:50 +0100)] 
clock_getres.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoaccept.2, acct.2, bind.2, clock_getres.2, connect.2, dup.2, epoll_create.2, eventfd...
Michael Kerrisk [Tue, 29 Dec 2015 12:48:42 +0000 (13:48 +0100)] 
accept.2, acct.2, bind.2, clock_getres.2, connect.2, dup.2, epoll_create.2, eventfd.2, execve.2, fanotify_init.2, fcntl.2, fork.2, futex.2, get_robust_list.2, getcpu.2, getpeername.2, getrlimit.2, getsockname.2, getsockopt.2, gettimeofday.2, inotify_init.2, listen.2, membarrier.2, memfd_create.2, mlock.2, mmap.2, personality.2, pipe.2, poll.2, recv.2, send.2, sendfile.2, shmget.2, shutdown.2, sigreturn.2, socket.2, socketcall.2, socketpair.2, spu_create.2, swapon.2, time.2, timerfd_create.2, uselib.2, dlerror.3, dlopen.3, drand48.3, errno.3, fnmatch.3, getgrent.3, getgrnam.3, getlogin.3, getpwent.3, getpwnam.3, iconv.3, mq_open.3, opendir.3, random_r.3, sem_open.3, shm_open.3, tmpfile.3, tzset.3, random.4, fanotify.7, futex.7, vdso.7, ld.so.8: tstamp

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoChanges: Ready for 4.04
Michael Kerrisk [Mon, 28 Dec 2015 10:37:26 +0000 (11:37 +0100)] 
Changes: Ready for 4.04

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofnmatch.3: Describe the FNM_EXTMATCH flag and pattern syntax
Pádraig Brady [Thu, 15 Oct 2015 08:58:28 +0000 (09:58 +0100)] 
fnmatch.3: Describe the FNM_EXTMATCH flag and pattern syntax

Signed-off-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoaccept.2, acct.2, epoll_create.2, execve.2, futex.2, inotify_init.2, mmap.2, open...
Michael Kerrisk [Sun, 27 Dec 2015 16:10:23 +0000 (17:10 +0100)] 
accept.2, acct.2, epoll_create.2, execve.2, futex.2, inotify_init.2, mmap.2, open.2, pipe.2, shmget.2, socket.2, socketpair.2, spu_create.2, swapon.2, uselib.2, getgrent.3, getgrnam.3, getlogin.3, getpwent.3, getpwnam.3, mq_open.3, opendir.3, sem_open.3, shm_open.3, tmpfile.3, fanotify.7: ERRORS: standardize text for ENFILE error

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoproc.5: Reaching /proc/sys/fs/file-max limit normally produces an ENFILE error
Michael Kerrisk [Sun, 27 Dec 2015 16:05:07 +0000 (17:05 +0100)] 
proc.5: Reaching /proc/sys/fs/file-max limit normally produces an ENFILE error

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoerrno.3: Note probable cause of ENFILE error
Michael Kerrisk [Sun, 27 Dec 2015 16:03:41 +0000 (17:03 +0100)] 
errno.3: Note probable cause of ENFILE error

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoaccept.2, dup.2, eventfd.2, execve.2, fcntl.2, memfd_create.2, open.2, perf_event_ope...
Michael Kerrisk [Sun, 27 Dec 2015 15:35:01 +0000 (16:35 +0100)] 
accept.2, dup.2, eventfd.2, execve.2, fcntl.2, memfd_create.2, open.2, perf_event_open.2, pipe.2, signalfd.2, socket.2, socketpair.2, spu_create.2, timerfd_create.2, getgrent.3, getgrnam.3, getlogin.3, getpwent.3, getpwnam.3, mq_open.3, opendir.3, sem_open.3, shm_open.3, tmpfile.3: ERRORS: standardize text for EMFILE error

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoinotify_init.2: ERRORS: add an EMFILE error case
Michael Kerrisk [Sun, 27 Dec 2015 15:27:49 +0000 (16:27 +0100)] 
inotify_init.2: ERRORS: add an EMFILE error case

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofanotify_init.2: ERRORS: add an EMFILE error case
Michael Kerrisk [Sun, 27 Dec 2015 15:26:07 +0000 (16:26 +0100)] 
fanotify_init.2: ERRORS: add an EMFILE error case

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoepoll_create.2: ERRORS: add another EMFILE error case
Michael Kerrisk [Sun, 27 Dec 2015 15:24:40 +0000 (16:24 +0100)] 
epoll_create.2: ERRORS: add another EMFILE error case

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoaccept.2, bind.2, connect.2, getpeername.2, getsockname.2, getsockopt.2, listen.2...
Michael Kerrisk [Sun, 27 Dec 2015 15:20:52 +0000 (16:20 +0100)] 
accept.2, bind.2, connect.2, getpeername.2, getsockname.2, getsockopt.2, listen.2, recv.2, send.2, shutdown.2: ERRORS: standardize error text for ENOTSOCK error

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoscanf.3: Minor wording tweaks in RETURN VALUE
Michael Kerrisk [Sun, 27 Dec 2015 15:00:29 +0000 (16:00 +0100)] 
scanf.3: Minor wording tweaks in RETURN VALUE

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agodlerror.3: Clarify that the string returned by dlerror() is null terminated
Michael Kerrisk [Sat, 26 Dec 2015 15:58:46 +0000 (16:58 +0100)] 
dlerror.3: Clarify that the string returned by dlerror() is null terminated

Reported-by: Jonny Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Minor wording tweaks after comments from Darren Hart
Michael Kerrisk [Sat, 26 Dec 2015 08:02:35 +0000 (09:02 +0100)] 
futex.2: Minor wording tweaks after comments from Darren Hart

Reported-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agopersonality.2: Note kernel and glibc versions that introduced this system call
Dmitry V. Levin [Thu, 24 Dec 2015 22:47:06 +0000 (01:47 +0300)] 
personality.2: Note kernel and glibc versions that introduced this system call

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agopoll.2: Shorten name of timeout argument for ppoll()
Michael Kerrisk [Wed, 23 Dec 2015 22:25:41 +0000 (23:25 +0100)] 
poll.2: Shorten name of timeout argument for ppoll()

The name is overly long, and does not hint at the fact
that this argument is a pointer. Fix this by renaming:
s/timeout_ts/tmo_p/

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agopoll.2: timeout_ts is a pointer, so use -> not . for member access
richardvoigt@gmail.com [Wed, 23 Dec 2015 19:30:29 +0000 (13:30 -0600)] 
poll.2: timeout_ts is a pointer, so use -> not . for member access

From the context, it is apparent that in the code explaining
ppoll in terms of poll, timeout_ts must be a pointer.

Usage #1:   ready = ppoll(&fds, nfds, timeout_ts, &sigmask);

Usage #2:    (timeout_ts == NULL)

Thus member access in (timeout_ts.tv_sec * 1000 +
timeout_ts.tv_nsec / 1000000) is an error.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofork.2: Child of MT-process is restricted to async-signal-safe functions
Michael Kerrisk [Tue, 22 Dec 2015 13:58:30 +0000 (14:58 +0100)] 
fork.2: Child of MT-process is restricted to async-signal-safe functions

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agorandom.4: Use modern command substitution syntax in shell session log
Michael Kerrisk [Sun, 20 Dec 2015 20:58:12 +0000 (21:58 +0100)] 
random.4: Use modern command substitution syntax in shell session log

Reported-by: Walter Harms <wharms@bfs.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agomembarrier.2: tfix
Mathieu Desnoyers [Fri, 18 Dec 2015 19:41:00 +0000 (14:41 -0500)] 
membarrier.2: tfix

"Ready-Copy-Update" should read "Read-Copy-Update".

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agosocketcall.2: Since Linux 4.3, x86-32 provides direct system calls for the sockets API
Michael Kerrisk [Sun, 20 Dec 2015 08:33:02 +0000 (09:33 +0100)] 
socketcall.2: Since Linux 4.3, x86-32 provides direct system calls for the sockets API

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: wfix
Michael Kerrisk [Sat, 19 Dec 2015 05:22:47 +0000 (06:22 +0100)] 
futex.2: wfix

Reported-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Minor wording fixes
Michael Kerrisk [Sat, 19 Dec 2015 05:21:41 +0000 (06:21 +0100)] 
futex.2: Minor wording fixes

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Replace "bitset" by "bit mask"
Michael Kerrisk [Sat, 19 Dec 2015 05:10:00 +0000 (06:10 +0100)] 
futex.2: Replace "bitset" by "bit mask"

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoCPU_SET.3: wfix
Michael Kerrisk [Sat, 19 Dec 2015 05:05:09 +0000 (06:05 +0100)] 
CPU_SET.3: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoepoll_ctl.2: wfix
Michael Kerrisk [Sat, 19 Dec 2015 05:03:41 +0000 (06:03 +0100)] 
epoll_ctl.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agodrand48.3: Correct descriptions of ranges returned by these functions
Michael Kerrisk [Thu, 17 Dec 2015 14:02:52 +0000 (15:02 +0100)] 
drand48.3: Correct descriptions of ranges returned by these functions

See http://bugs.debian.org/803459

Reported-by: Vincent Lefevre <vincent@vinc17.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agorandom_r.3: Clarify need to use initstate_r()
Michael Kerrisk [Thu, 17 Dec 2015 08:36:37 +0000 (09:36 +0100)] 
random_r.3: Clarify need to use initstate_r()

As noted by Archie Cobbs:

I was trying to use srandom_() and initstate_r() and fell into
the exact same trap this this fellow did:
http://stackoverflow.com/questions/18569523/segfault-at-srandom-r,
resulting in a segfault.

The man page is really unclear here. It leads one to believe
(falsely) that invoking setrandom_r() is sufficient to initialize
a struct random_data, but this is not the case. In fact
srandom_r() is not like srandom() at all in this respect.

Reported-by: Archie Cobbs <archie.cobbs@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agorandom.4: Rework example scripts to assume 'poolsize' unit is bits, not bytes
Michael Kerrisk [Thu, 17 Dec 2015 07:47:27 +0000 (08:47 +0100)] 
random.4: Rework example scripts to assume 'poolsize' unit is bits, not bytes

Reported-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agogetrandom.2: tfix
Michael Kerrisk [Thu, 17 Dec 2015 07:21:13 +0000 (08:21 +0100)] 
getrandom.2: tfix

Reported-by: Colin Rice <colin@daedrum.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agogetrlimit.2: The init of measurement for RLIMIT_RSS is bytes, not pages
Michael Kerrisk [Thu, 17 Dec 2015 07:17:09 +0000 (08:17 +0100)] 
getrlimit.2: The init of measurement for RLIMIT_RSS is bytes, not pages

Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agotime.2: Rename 't' argument to 'tloc'
Michael Kerrisk [Thu, 17 Dec 2015 05:47:49 +0000 (06:47 +0100)] 
time.2: Rename 't' argument to 'tloc'

'tloc' is visually easier to spot, and also is used
in POSIX and in man pages on other systems.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agotime.2: Describe EOVERFLOW details
Michael Kerrisk [Thu, 17 Dec 2015 05:38:14 +0000 (06:38 +0100)] 
time.2: Describe EOVERFLOW details

Heavily based on text proposed by Paul Eggert.

Cowritten-by: Paul Eggert <eggert@cs.ucla.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Fixes after comments from Darren Hart
Michael Kerrisk [Wed, 16 Dec 2015 15:53:45 +0000 (16:53 +0100)] 
futex.2: Fixes after comments from Darren Hart

Reported-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Clarify "total ordering" a little
Michael Kerrisk [Wed, 16 Dec 2015 15:35:30 +0000 (16:35 +0100)] 
futex.2: Clarify "total ordering" a little

Comments from Davidlohr:

    So there are two things here regarding ordering. One is the
    most obvious which is ordered due to the taking/dropping the
    hb spinlock. Secondly, its the cases which Peter brought up
    a while ago that involves atomic futex ops futex_atomic_*(),
    which do not have clearly defined semantics, and you get
    inconsistencies with certain archs (tile being the worst
    iirc).

    But anyway, the important thing users need to know about is
    that the atomic futex operation must be totally ordered wrt
    any other user tasks that are trying to access that address.
    This is not necessarily the case for kernel ops. Peter
    illustrates this nicely with lock stealing example; (see
    https://lkml.org/lkml/2015/8/26/596).

    Internally, I believe we decided that making it fully ordered
    (as opposed to making use of implicit barriers for
    ACQUIRE/RELEASE), so you'd end up having an MB ll/sc MB kind of
    setup.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Reported-by: Davidlohr Bueso <dave@stgolabs.net>
8 years agosendfile.2: Document more ERRORS
Laurent Georget [Fri, 11 Dec 2015 20:10:04 +0000 (21:10 +0100)] 
sendfile.2: Document more ERRORS

sendfile(2) can return more error codes than are
documented in sendfile(2). This patch adds some details:

    - EINVAL can be returned if count is negative; from function
      rw_verify_area in fs/read_write.c, called from do_sendfile,
      called from sys_sendfile.
    - EOVERFLOW can be returned if count is too large; from
      rw_verify_area, called from do_sendfile, called from
      sys_sendfile, or directly from do_sendfile in one case
      (pos + count > max size of either in_fd or out_fd).
    - ESPIPE can be returned if offset is not a NULL pointer but
      the input file does not support FMODE_PREAD;
      from do_sendfile, called from sys_sendfile.

Signed-off-by: Laurent Georget <laurent.georget@supelec.fr>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agotime.2: Explain why the glibc time() wrapper never sets 'errno'
Zack Weinberg [Wed, 16 Dec 2015 15:02:59 +0000 (16:02 +0100)] 
time.2: Explain why the glibc time() wrapper never sets 'errno'

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agotime.2: Where time() is provided by vDSO, an invalid address may give SIGSEGV
Michael Kerrisk [Wed, 16 Dec 2015 13:35:16 +0000 (14:35 +0100)] 
time.2: Where time() is provided by vDSO, an invalid address may give SIGSEGV

Reported-by: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agotzset.3: Clarify "daylight" and remove erroneous note
Carlos O'Donell [Thu, 10 Dec 2015 22:05:02 +0000 (17:05 -0500)] 
tzset.3: Clarify "daylight" and remove erroneous note

When tzset is run the value of daylight is computed
by looking at all available rules for the application
of daylight savings. This includes reading the tzdata
files to determine if there is a transition or not for
the current timezone. It also includes parsing TZ env
to see if it specifies custom rules which are used in
precedence to any tzdata rules. Therefore daylight is
going to be set if there is a daylight saving rule past,
present, or future that indicates a transition. We clarify
that in the man page.

Lastly, the note about tz_dsttime is not correct and is
removed. The earlier paragraph about daylight makes it
clear that it doesn't mean "daylight saving rule applies
now", and the interaction with tz_dsttime is not correct
for glibc on Linux (as outlined in my gettimeofday.3 patch
sent here: http://marc.info/?l=linux-man&m=144977768703615&w=2).

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agogettimeofday.2: Minor tweaks
Michael Kerrisk [Wed, 16 Dec 2015 14:13:29 +0000 (15:13 +0100)] 
gettimeofday.2: Minor tweaks

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agogettimeofday.2: Expand on the historic historical meaning of tz_dsttime
Carlos O'Donell [Thu, 10 Dec 2015 20:01:25 +0000 (15:01 -0500)] 
gettimeofday.2: Expand on the historic historical meaning of tz_dsttime

Given that the NOTES in question are willing to discuss
history, I have clarified the use of tz_dsttime for non-Linux
and Linux to allow the reader to contrast that with the older
system usage.

On a non-Linux glibc the meaning of tz_dsttime is exactly
that of daylight for the current zone. It has been this way
since the beginning of glibc:

^28f540f (Roland McGrath 1995-02-18 01:27:10 +0000 52)
       tz->tz_dsttime = __daylight;

On a Linux glibc the field has never been used.

Clarify the meaning of tz_dsttime for gettimeofday,
and for settimeofday distinctly for non-Linux and Linux
glibc cases (for historical completeness).

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agold.so.8: tfix
Michael Kerrisk [Wed, 16 Dec 2015 14:33:10 +0000 (15:33 +0100)] 
ld.so.8: tfix

Reported-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agold.so.8: Clarify setting of LD_TRACE_PRELINKING
Michael Kerrisk [Wed, 16 Dec 2015 14:32:04 +0000 (15:32 +0100)] 
ld.so.8: Clarify setting of LD_TRACE_PRELINKING

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agold.so.8: Clarify some details for LD_SHOW_AUXV
Michael Kerrisk [Wed, 16 Dec 2015 14:31:20 +0000 (15:31 +0100)] 
ld.so.8: Clarify some details for LD_SHOW_AUXV

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agold.so.8: Clarify setting of LD_DYNAMIC_WEAK
Michael Kerrisk [Wed, 16 Dec 2015 14:28:18 +0000 (15:28 +0100)] 
ld.so.8: Clarify setting of LD_DYNAMIC_WEAK

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agold.so.8: Clarify setting of LD_BIND_NOT
Michael Kerrisk [Wed, 16 Dec 2015 14:25:49 +0000 (15:25 +0100)] 
ld.so.8: Clarify setting of LD_BIND_NOT

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agold.so.8: Tweaks to H.J. Lu's patch
Michael Kerrisk [Wed, 16 Dec 2015 13:59:39 +0000 (14:59 +0100)] 
ld.so.8: Tweaks to H.J. Lu's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agold.so.8: Document LD_PREFER_MAP_32BIT_EXEC
H.J. Lu [Wed, 16 Dec 2015 13:40:40 +0000 (14:40 +0100)] 
ld.so.8: Document LD_PREFER_MAP_32BIT_EXEC

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agosigreturn.2: SEE ALSO: add vdso(7)
Michael Kerrisk [Wed, 16 Dec 2015 13:15:58 +0000 (14:15 +0100)] 
sigreturn.2: SEE ALSO: add vdso(7)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agogettimeofday.2: SEE ALSO: add vdso(7)
Michael Kerrisk [Wed, 16 Dec 2015 13:14:46 +0000 (14:14 +0100)] 
gettimeofday.2: SEE ALSO: add vdso(7)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoclock_getres.2: SEE ALSO: add vdso(7)
Michael Kerrisk [Wed, 16 Dec 2015 13:14:18 +0000 (14:14 +0100)] 
clock_getres.2: SEE ALSO: add vdso(7)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agotime.2: SEE ALSO: add vdso(7)
Michael Kerrisk [Wed, 16 Dec 2015 13:13:59 +0000 (14:13 +0100)] 
time.2: SEE ALSO: add vdso(7)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agogetcpu.2: SEE ALSO: add vdso(7)
Michael Kerrisk [Wed, 16 Dec 2015 13:12:48 +0000 (14:12 +0100)] 
getcpu.2: SEE ALSO: add vdso(7)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agoiconv.3: NOTES: describe correct usage for flushing partially buffered input
Andries E. Brouwer [Wed, 16 Dec 2015 10:27:36 +0000 (11:27 +0100)] 
iconv.3: NOTES: describe correct usage for flushing partially buffered input

The following came up yesterday on the wget list.
The iconv.3 man page says

"... 2. The input byte sequence has been entirely converted,
 i.e. *inbytesleft has gone down to 0."

and

"A  different  case is when inbuf is NULL or *inbuf is NULL,
 but outbuf is not NULL and *outbuf is not NULL. In this case,
 the iconv function attempts to set cd's conversion state to the
 initial state and store  a  corresponding shift sequence at
 *outbuf."

The POSIX page says

"For state-dependent encodings, the conversion descriptor cd is
 placed into its initial shift state by a call for which inbuf
 is a null pointer, or for which inbuf points to a null pointer.
 When iconv() is called in this way, and if outbuf is not a null
 pointer or a pointer to a null pointer, and outbytesleft points
 to a positive value, iconv() shall place, into the output buffer,
 the byte sequence to change the output buffer to its initial
shift state."

These texts are slightly misleading, in the sense that, in the
present implementation, iconv() may implement conversion
from an encoding that is not state-dependent in a way that
uses an artificial shift state to store lookahead bytes.
That means that after conversion, when *inbytesleft has gone
down to 0, it may be that contrary to what iconv.3 suggests not
all output has been stored, and a final flushing call is needed.

Maybe this violates POSIX.

A minimal warning is added by this patch.

--- man-pages-4.03/man3/iconv.3 2015-12-05 10:45:25.000000000 +0100
+++ ./iconv.3   2015-12-16 01:41:38.253049938 +0100
@@ -161,6 +161,11 @@
 .SH CONFORMING TO
 POSIX.1-2001, POSIX.1-2008.
 .SH NOTES
+In each series of calls to
+.BR iconv (),
+the last should be one with \fIinbuf\fP or \fI*inbuf\fP equal to NULL,
+in order to flush out any partially converted input.
+
 Although
 .I inbuf
 and

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agomembarrier.2: wfix
Mathieu Desnoyers [Tue, 15 Dec 2015 18:54:10 +0000 (13:54 -0500)] 
membarrier.2: wfix

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agovdso.7: Add note on strace(1) and vDSO
Michael Kerrisk [Tue, 15 Dec 2015 19:24:21 +0000 (20:24 +0100)] 
vdso.7: Add note on strace(1) and vDSO

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agomembarrier.2: Rework discussion of 'cmd'
Michael Kerrisk [Tue, 15 Dec 2015 15:23:11 +0000 (16:23 +0100)] 
membarrier.2: Rework discussion of 'cmd'

Simplify and eliminate some redundancy.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agomembarrier.2: Remove redundant mention of return value of MEMBARRIER_CMD_SHARED
Michael Kerrisk [Tue, 15 Dec 2015 15:19:10 +0000 (16:19 +0100)] 
membarrier.2: Remove redundant mention of return value of MEMBARRIER_CMD_SHARED

This detail is already covered in RETURN VALUE.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agomembarrier.2: Clarify details of return value
Michael Kerrisk [Tue, 15 Dec 2015 15:15:39 +0000 (16:15 +0100)] 
membarrier.2: Clarify details of return value

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agomembarrier.2: Clarify return value for MEMBARRIER_CMD_QUERY
Michael Kerrisk [Tue, 15 Dec 2015 15:11:06 +0000 (16:11 +0100)] 
membarrier.2: Clarify return value for MEMBARRIER_CMD_QUERY

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agomembarrier.2: Minor fixups to Mathieu's text
Michael Kerrisk [Tue, 15 Dec 2015 14:53:49 +0000 (15:53 +0100)] 
membarrier.2: Minor fixups to Mathieu's text

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agomembarrier.2: New page documenting membarrier() system call
Mathieu Desnoyers [Sun, 13 Dec 2015 13:17:43 +0000 (08:17 -0500)] 
membarrier.2: New page documenting membarrier() system call

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Nicholas Miell <nmiell@comcast.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Pranith Kumar <bobby.prani@gmail.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
CC: linux-api@vger.kernel.org
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Minor fixes after comments from Torvald Riegel
Michael Kerrisk [Tue, 15 Dec 2015 16:00:04 +0000 (17:00 +0100)] 
futex.2: Minor fixes after comments from Torvald Riegel

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: tfix
Michael Kerrisk [Tue, 15 Dec 2015 15:47:52 +0000 (16:47 +0100)] 
futex.2: tfix

Reported-by: Alexander Monakov <amonakov@ispras.ru>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: srcfix (notes from conversation with tglx)
Michael Kerrisk [Thu, 8 Oct 2015 10:17:59 +0000 (11:17 +0100)] 
futex.2: srcfix (notes from conversation with tglx)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: tfix
Michael Kerrisk [Tue, 15 Dec 2015 12:11:15 +0000 (13:11 +0100)] 
futex.2: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: wfix
Michael Kerrisk [Thu, 8 Oct 2015 21:17:47 +0000 (23:17 +0200)] 
futex.2: wfix

Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Fixes after feedback from Thomas Gleixner
Michael Kerrisk [Fri, 21 Aug 2015 16:30:00 +0000 (09:30 -0700)] 
futex.2: Fixes after feedback from Thomas Gleixner

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Minor wording fixes
Michael Kerrisk [Sun, 9 Aug 2015 08:38:40 +0000 (10:38 +0200)] 
futex.2: Minor wording fixes

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Improvements after comments from Darren Hart
Michael Kerrisk [Sat, 8 Aug 2015 06:28:17 +0000 (08:28 +0200)] 
futex.2: Improvements after comments from Darren Hart

Reported-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: ffix
Michael Kerrisk [Sat, 8 Aug 2015 06:28:59 +0000 (08:28 +0200)] 
futex.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: srcfix: FIXME
Michael Kerrisk [Fri, 7 Aug 2015 20:54:22 +0000 (22:54 +0200)] 
futex.2: srcfix: FIXME

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Fixes after review comments from Thomas Gleixner
Michael Kerrisk [Fri, 7 Aug 2015 20:41:53 +0000 (22:41 +0200)] 
futex.2: Fixes after review comments from Thomas Gleixner

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Various fixes after comments from Thomas Gleixner
Michael Kerrisk [Fri, 7 Aug 2015 14:31:23 +0000 (16:31 +0200)] 
futex.2: Various fixes after comments from Thomas Gleixner

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: wfix
Michael Kerrisk [Thu, 30 Jul 2015 14:05:01 +0000 (16:05 +0200)] 
futex.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: tfix
Michael Kerrisk [Thu, 30 Jul 2015 14:03:14 +0000 (16:03 +0200)] 
futex.2: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: wfix
Michael Kerrisk [Thu, 30 Jul 2015 14:01:56 +0000 (16:01 +0200)] 
futex.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: wfix
Michael Kerrisk [Thu, 30 Jul 2015 13:52:22 +0000 (15:52 +0200)] 
futex.2: wfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Fixes after review comments from Thomas Gleixner
Michael Kerrisk [Thu, 30 Jul 2015 13:43:54 +0000 (15:43 +0200)] 
futex.2: Fixes after review comments from Thomas Gleixner

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: tfix
Michael Kerrisk [Thu, 30 Jul 2015 12:19:40 +0000 (14:19 +0200)] 
futex.2: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Elaborate on why "requeue" operations can be preferable to FUTEX_WAKE
Michael Kerrisk [Thu, 30 Jul 2015 12:18:23 +0000 (14:18 +0200)] 
futex.2: Elaborate on why "requeue" operations can be preferable to FUTEX_WAKE

Cowritten-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Clean-ups and FIXME removeal after feedback from Thomas Gleixner
Michael Kerrisk [Thu, 30 Jul 2015 08:19:44 +0000 (10:19 +0200)] 
futex.2: Clean-ups and FIXME removeal after feedback from Thomas Gleixner

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Remove warning that FUTEX_REQUEUE is broken
Michael Kerrisk [Thu, 30 Jul 2015 07:17:53 +0000 (09:17 +0200)] 
futex.2: Remove warning that FUTEX_REQUEUE is broken

Darren Hart pointed me to the comments from Rich Felker
that there are valid use cases for FUTEX_REQUEUE.

    From: Rich Felker <dalias@libc.org>
    Date: Wed, 29 Oct 2014 22:43:17 -0400
    To: Darren Hart <dvhart@infradead.org>
Cc: GLIBC Devel <libc-alpha@sourceware.org>, ...
    Subject: Re: Add futex wrapper to glibc?

    On Wed, Oct 29, 2014 at 06:59:15PM -0700, Darren Hart wrote:
    [...]
    > I wonder though... can we not wrap FUTEX_REQUEUE? It's fundamentally
    > broken.  FUTEX_CMP_REQUEUE should *always* be used instead. The glibc
    > wrapper is one way to encourage developers to do the right thing
    > (don't expose the bad op in the header).

    You're mistaken here. There are plenty of valid ways to use
    FUTEX_REQUEUE - for example if the calling thread is requeuing the
    target(s) to a lock that the calling thread owns. Just because it
    doesn't meet the needs of the way glibc was using it internally
    doesn't mean it's useless for other applications.

Reported-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: srcfix
Michael Kerrisk [Wed, 29 Jul 2015 11:20:52 +0000 (13:20 +0200)] 
futex.2: srcfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Minor wording fixes
Michael Kerrisk [Tue, 28 Jul 2015 09:09:15 +0000 (11:09 +0200)] 
futex.2: Minor wording fixes

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Minor wording fixes
Michael Kerrisk [Tue, 28 Jul 2015 08:51:45 +0000 (10:51 +0200)] 
futex.2: Minor wording fixes

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: tfix
Michael Kerrisk [Tue, 28 Jul 2015 08:10:00 +0000 (10:10 +0200)] 
futex.2: tfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Rewrap some source lines (no content changes)
Michael Kerrisk [Tue, 28 Jul 2015 08:09:32 +0000 (10:09 +0200)] 
futex.2: Rewrap some source lines (no content changes)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Minor wording fixes
Michael Kerrisk [Tue, 28 Jul 2015 08:04:10 +0000 (10:04 +0200)] 
futex.2: Minor wording fixes

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Minor wording fixes
Michael Kerrisk [Tue, 28 Jul 2015 07:51:35 +0000 (09:51 +0200)] 
futex.2: Minor wording fixes

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Reword paragraph describing futex word
Michael Kerrisk [Tue, 28 Jul 2015 07:38:47 +0000 (09:38 +0200)] 
futex.2: Reword paragraph describing futex word

Reported-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: NOTES: futexes are also used to implement read-write locks and barriers
Michael Kerrisk [Tue, 28 Jul 2015 06:52:47 +0000 (08:52 +0200)] 
futex.2: NOTES: futexes are also used to implement read-write locks and barriers

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: SEE ALSO: add pthread_mutexattr_getprotocol(3)
Michael Kerrisk [Tue, 28 Jul 2015 06:38:43 +0000 (08:38 +0200)] 
futex.2: SEE ALSO: add pthread_mutexattr_getprotocol(3)

Reported-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: wfix
Michael Kerrisk [Mon, 27 Jul 2015 14:43:10 +0000 (16:43 +0200)] 
futex.2: wfix

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Tidy up some FIXMEs
Michael Kerrisk [Mon, 27 Jul 2015 11:31:38 +0000 (13:31 +0200)] 
futex.2: Tidy up some FIXMEs

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Point out that futexes are used to implement higher-level abstractions
Michael Kerrisk [Mon, 27 Jul 2015 11:09:45 +0000 (13:09 +0200)] 
futex.2: Point out that futexes are used to implement higher-level abstractions

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Torvald Riegel <triegel@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
8 years agofutex.2: Remove an obsolete FIXME
Michael Kerrisk [Mon, 27 Jul 2015 11:01:54 +0000 (13:01 +0200)] 
futex.2: Remove an obsolete FIXME

Reviewed-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>