Commit Graph

15080 Commits

Author SHA1 Message Date
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
Michael Kerrisk ac89487996 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 dcb410c3c8 futex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:49 +01:00
Michael Kerrisk 627b50ce7c 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>
2015-12-15 14:39:48 +01:00
Michael Kerrisk 8297383e9e 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>
2015-12-15 14:39:48 +01:00
Michael Kerrisk 27dd3a6e79 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>
2015-12-15 14:39:48 +01:00
Michael Kerrisk da56650ae4 futex.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk fd1056148b futex.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk 55f9e85ead futex.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk b0f35fbb09 futex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00