Commit Graph

15039 Commits

Author SHA1 Message Date
Michael Kerrisk 3f4a2adb06 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>
2015-12-17 08:47:27 +01:00
Michael Kerrisk 0594459d21 getrandom.2: tfix
Reported-by: Colin Rice <colin@daedrum.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-17 08:21:13 +01:00
Michael Kerrisk ce3f60394d 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>
2015-12-17 08:17:09 +01:00
Michael Kerrisk ab708dcbb2 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>
2015-12-17 06:49:29 +01:00
Michael Kerrisk 4af94291ae 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>
2015-12-17 06:49:29 +01:00
Michael Kerrisk da894b18a8 futex.2: Fixes after comments from Darren Hart
Reported-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-17 06:43:53 +01:00
Michael Kerrisk 0fb87d16ac 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>
2015-12-17 06:43:40 +01:00
Laurent Georget 4975d6af79 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>
2015-12-16 16:43:45 +01:00
Zack Weinberg 300c07ddd8 time.2: Explain why the glibc time() wrapper never sets 'errno'
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 16:43:45 +01:00
Michael Kerrisk 1ccb57efbc 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>
2015-12-16 16:43:45 +01:00
Carlos O'Donell 17e9724a2e 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>
2015-12-16 16:43:45 +01:00
Michael Kerrisk 53e0c29347 gettimeofday.2: Minor tweaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 16:43:44 +01:00
Carlos O'Donell 43d6713ebe 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>
2015-12-16 16:43:44 +01:00
Michael Kerrisk 81583be914 ld.so.8: tfix
Reported-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 16:43:44 +01:00
Michael Kerrisk a5817257f2 ld.so.8: Clarify setting of LD_TRACE_PRELINKING
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 16:43:44 +01:00
Michael Kerrisk b5ccc9bb18 ld.so.8: Clarify some details for LD_SHOW_AUXV
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 16:43:44 +01:00
Michael Kerrisk 963c1947e1 ld.so.8: Clarify setting of LD_DYNAMIC_WEAK
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 16:43:44 +01:00
Michael Kerrisk 01132bd6c7 ld.so.8: Clarify setting of LD_BIND_NOT
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 16:43:44 +01:00
Michael Kerrisk 3cdc1fc4a1 ld.so.8: Tweaks to H.J. Lu's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 16:43:44 +01:00
H.J. Lu 5b479f37b6 ld.so.8: Document LD_PREFER_MAP_32BIT_EXEC
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 16:43:44 +01:00
Michael Kerrisk cc15860198 sigreturn.2: SEE ALSO: add vdso(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 14:33:36 +01:00
Michael Kerrisk 7032b90a7b gettimeofday.2: SEE ALSO: add vdso(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 14:33:36 +01:00
Michael Kerrisk 18688d1731 clock_getres.2: SEE ALSO: add vdso(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 14:33:36 +01:00
Michael Kerrisk 080d3d60e0 time.2: SEE ALSO: add vdso(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 14:33:36 +01:00
Michael Kerrisk 5dfbd2635e getcpu.2: SEE ALSO: add vdso(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 14:33:36 +01:00
Andries E. Brouwer c89ca4366c 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>
2015-12-16 11:27:36 +01:00
Mathieu Desnoyers 51866840d7 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>
2015-12-16 11:27:15 +01:00
Michael Kerrisk afc40b0735 vdso.7: Add note on strace(1) and vDSO
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 20:24:21 +01:00
Michael Kerrisk 84015a2273 membarrier.2: Rework discussion of 'cmd'
Simplify and eliminate some redundancy.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 17:01:04 +01:00
Michael Kerrisk a93704ad50 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>
2015-12-15 17:01:04 +01:00
Michael Kerrisk 7a9c62ef10 membarrier.2: Clarify details of return value
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 17:01:04 +01:00
Michael Kerrisk 9eb5be29b8 membarrier.2: Clarify return value for MEMBARRIER_CMD_QUERY
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 17:01:04 +01:00
Michael Kerrisk 7e6241dc67 membarrier.2: Minor fixups to Mathieu's text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 17:01:04 +01:00
Mathieu Desnoyers d06aa1bf7a 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>
2015-12-15 17:01:04 +01:00
Michael Kerrisk 3fbb1be115 futex.2: Minor fixes after comments from Torvald Riegel
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 17:00:04 +01:00
Michael Kerrisk 57f2d48bc1 futex.2: tfix
Reported-by: Alexander Monakov <amonakov@ispras.ru>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 16:47:52 +01:00
Michael Kerrisk ee65b0e842 futex.2: srcfix (notes from conversation with tglx)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk c3f4c0196a futex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk d0442d147d futex.2: wfix
Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk 1d09c1500f futex.2: Fixes after feedback from Thomas Gleixner
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk ca4e5b2b99 futex.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk 601399f31f futex.2: Improvements after comments from Darren Hart
Reported-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk adc89a976e futex.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk 41b6c6a080 futex.2: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk c3875d1d3a 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>
2015-12-15 14:39:49 +01:00
Michael Kerrisk 30239c10a8 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>
2015-12-15 14:39:49 +01:00
Michael Kerrisk aab5ca4b64 futex.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk f0a9e8f4ce futex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk 39e9b2e1e4 futex.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk 9cee832c40 futex.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00