Commit Graph

4049 Commits

Author SHA1 Message Date
Michael Kerrisk 39b23549b8 syslog.3: Remove unneeded <stdarg.h>
vsyslog() does not need this.

Reported-by: Doug Goldstein <cardoe@gentoo.org>

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Michael Kerrisk ca12634681 pthread_attr_setschedparam.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Tobias Herzke 3f6dadab7b pthread_attr_setschedparam.3: Describe EINVAL in ERRORS
The following example proves that the man page
pthread_attr_setschedparam.3 is incorrect when it claims that the
pthread_attr_setschedparam function always succeeds on linux:

int main() {
   pthread_attr_t attr;
   struct sched_param p = {-1}; /* invalid priority */
   if (pthread_attr_init(&attr) == 0)
     if (pthread_attr_setschedpolicy(&attr, SCHED_OTHER) == 0)
       if (pthread_attr_setschedparam(&attr, &p) == EINVAL)
	return 1;
   return 0;
}

The program exits with exit code 1, therefore
pthread_attr_setschedparam() has returned error code EINVAL.

I could evoke this error on ubuntu 14.04, and verify it by
examining the eglibc-2.19 source code. The function is
implemented in file fbtl/pthread_attr_setschedparam.c. For
error checking, it calls the helper function
check_sched_priority_attr which is implemented inline in
file ./fbtl/pthreadP.h. This function returns EINVAL if a
range check fails.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Rob Somers ec5308ca6e encrypt.3: Improve code example
I (and some others) found that the original example code
did not seem to work as advertised.  The new code (used by
permission of the original author, Jens Thoms Toerring)
was found on comp.os.linux.development.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 08:32:11 +01:00
Michael Kerrisk 60569afd98 getnameinfo.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:28 +01:00
Michael Kerrisk c49a8e2a02 getutent.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-21 07:58:28 +01:00
Michael Kerrisk a288791dc7 tzset.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-02 07:37:31 +01:00
J William Piggott 09e421f1aa tzset.3: ffix
Fix tzset.3 regression, dst is optional.

$ date
Sun Feb  1 15:14:33 EST 2015
$ TZ=NZST-12 date
Mon Feb  2 08:14:38 NZST 2015
$ TZ=EST5 date
Sun Feb  1 15:15:02 EST 2015

Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-02 07:32:59 +01:00
Michael Kerrisk 9dc53e71c2 kexec_load.2, personality.2, prctl.2, reboot.2, socket.2, fflush.3, getopt.3, random.3, termios.3, random.4, passwd.5, capabilities.7, signal.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-01 17:14:12 +01:00
Michael Kerrisk dbc45ff182 tzset.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-01 17:04:21 +01:00
J William Piggott 343d131418 tzset.3: typos and version bump
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-01 16:30:36 +01:00
J William Piggott 411dded247 tzset.3: There are only two TZ formats
tzset(3) currently states that there are three TZ formats. The
first two it lists are actually variations of the POSIX-style
TZ format, of which there are at least five variations.

This patch corrects this to match the POSIX specification of
TZ having only two formats.

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html

Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-01 16:29:49 +01:00
J William Piggott a321c9154c tzset.3: Fix incorrect TZ string representation
The TZ string representation indicates that the start/end
rules are required; this is incorrect.

Updated the TZ string format to the POSIX specification and
improve its readability by having only the optional parts in
italics.

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html

Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-01 16:28:59 +01:00
Michael Kerrisk 35d82b2596 getopt.3: SEE ALSO: add getopt(1)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-01 09:27:24 +01:00
Michael Kerrisk c04700fb25 termios.3: SEE ALSO: add reset(1), setterm(1), tput(1)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-02-01 09:26:38 +01:00
J William Piggott 1cec674c72 tzset.3: Add description for posixrules file
Based upon reviewing the glibc source, the posixrules file is being used
for very specific TZ strings that can be represented as:

[:]stdoffsetdst[offset][,]

If anything follows the above string, even invalid data, posixrules will
not be used. Below is some shell output demonstrating this.

$ TZ="NZST-12:00:00NZDT-13:00:00,ANYTHING" \
strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
Thu Jan 29 06:53:35 NZDT 2015

$ TZ="NZST-12:00:00NZDT-13:00:00," \
strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
open("/usr/share/zoneinfo/posixrules", O_RDONLY|O_CLOEXEC) = 3
Thu Jan 29 05:54:58 NZST 2015

Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 23:19:19 +01:00
J William Piggott c1e90e15d3 tzset.3: Add ENVIRONMENT section + other rearrangements
FILES section was overly verbose and included
environment variables.  Added ENVIRONMENT section,
removing ENV VARS from the FILES section.

As stated in commit 2c7f200, /usr/share/zoneinfo/localtime
is not used, nor recommended by glibc.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 23:16:58 +01:00
Heinrich Schuchardt d929b8016b random.3: SEE ALSO: add getrandom(2)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-29 09:02:40 +01:00
Michael Kerrisk 0647fa15ee strcmp.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-28 10:08:11 +01:00
Michael Kerrisk 035ecf0a03 fmemopen.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-28 10:04:45 +01:00
Michael Kerrisk 7908afeac2 pow.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-28 10:04:40 +01:00
Michael Kerrisk f3f1456fde fclose.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-28 09:59:58 +01:00
Michael Kerrisk fb8d1da088 addseverity.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-28 09:57:23 +01:00
Michael Kerrisk 1c70978670 fflush.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-28 09:54:23 +01:00
Michael Kerrisk 7603353762 fflush.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-28 09:52:50 +01:00
Michael Kerrisk 199431b631 fflush.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-28 09:45:46 +01:00
Michael Kerrisk 6db34ce89f fflush.3: POSIX.1-2008 specifies the behavior when flushing input streams
POSIX.1-2001 did not have a specification for input streams,
but POSIX.1-2008 added one.

Reported-by: Sergey V. Zubkov <cubbi@cubbi.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-28 09:44:44 +01:00
Michael Kerrisk 099263cea7 fflush.3: Clarify that flushing of input streams occurs only for seekable files
See https://bugzilla.kernel.org/show_bug.cgi?id=91931

Reported-by: Sergey V. Zubkov <cubbi@cubbi.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-28 09:24:47 +01:00
Michael Kerrisk 520d6ed08e tzset.3: Clarify that first timezone format does not contain spaces
Reported-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-25 15:19:09 +01:00
JWP 2c7f2006a9 tzset.3: Correct system timezone file path
The manual incorrectly states the system timezone
path as /usr/share/zoneinfo/localtime. Glibc does
not use that file for anything, it uses
$(prefix)/etc/localtime.

There is an ambiguous reference in the man-page to
/etc/localtime, but it does not indicate that it
will be used. It states clearly that
/usr/share/zoneinfo/localtime is used.

A comment in the glibc Makeconfig even says that
file should not exist:

> ... relative to $(zonedir).  It is a good idea
> to put this somewhere other than there, so the
> zoneinfo directory contains only universal data,
> localizing the configuration data elsewhere.

Furthermore, the man page does not indicate the
reason this file is being used; which is because
it is the configured system timezone.

A later patch in this series addresses the
possibility that /etc/localtime could be changed
during glibc's compilation. The language changed
in this patch points to the FILE section which is
where the explanation will be. There is no reason
to repeat that information multiple times
throughout the man-page.

EVIDENCE:

glibc/Makeconfig:256: sysconfdir = $(prefix)/etc
glibc/Makeconfig:272: localtime-file = $(sysconfdir)/localtime

FROM INFO LIBC:
C.2 Installing the C Library
============================
   To configure the locally used timezone, set the `TZ' environment
variable.  The script `tzselect' helps you to select the right value.
As an example, for Germany, `tzselect' would tell you to use
`TZ='Europe/Berlin''.  For a system wide installation (the given paths
are for an installation with `--prefix=/usr'), link the timezone file
which is in `/usr/share/zoneinfo' to the file `/etc/localtime'.  For
Germany, you might execute `ln -s /usr/share/zoneinfo/Europe/Berlin
/etc/localtime'.

STEPS TO REPRODUCE:

cd /usr/share/zoneinfo/
cp Antarctica/South_Pole localtime
cp /US/Eastern /etc/localtime
cd
date
Sun Jan 18 12:06:36 EST 2015
TZ=:/usr/share/zoneinfo/localtime date
Mon Jan 19 06:06:54 NZDT 2015
rm /etc/localtime
date
Sun Jan 18 17:08:37 UTC 2015
TZ=:/usr/share/zoneinfo/localtime date
Mon Jan 19 06:08:41 NZDT 2015

Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-25 15:19:09 +01:00
JWP 025812041f tzset.3: Document behavior when TZ filespec omits the colon
If the TZ filespec omits the leading colon, glibc will parse
it for any valid format, i.e., it will still work.

STEPS TO REPRODUCE:
TZ=:Europe/Kiev date
Sun Jan 18 20:19:13 EET 2015
TZ=Europe/Kiev date
Sun Jan 18 20:19:20 EET 2015

Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-25 15:18:44 +01:00
JWP 4e00a0b860 tzset.3: Filespec omitted incorrect
Paragraph three of the DESCRIPTION section says
that when TZ is set, but empty, then UTC is used.

Later it says if the TZ filespec is omitted then the file
/usr/share/zoneinfo/localtime is used.  This is incorrect,
it will use UTC in that case as well.

Steps to reproduce:

cd /usr/share/zoneinfo/
cp Antarctica/South_Pole localtime
cd
date
Sun Jan 18 10:59:50 EST 2015
TZ=:Hongkong date
Sun Jan 18 23:59:56 HKT 2015
TZ=:/usr/share/zoneinfo/localtime date
Mon Jan 19 05:00:03 NZDT 2015
TZ=: date
Sun Jan 18 16:00:11 UTC 2015
TZ=":" date
Sun Jan 18 16:00:18 UTC 2015
TZ=':' date
Sun Jan 18 16:00:24 UTC 2015
TZ=:/ date
Sun Jan 18 16:00:34  2015
TZ=":/" date
Sun Jan 18 16:00:40  2015
TZ="" date
Sun Jan 18 16:00:45 UTC 2015

Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-25 15:18:44 +01:00
Michael Kerrisk 8392a3b33f _exit.2, dup.2, execve.2, execveat.2, fallocate.2, fcntl.2, get_robust_list.2, getrlimit.2, mbind.2, memfd_create.2, mmap.2, open.2, ptrace.2, readv.2, select.2, sigaction.2, syscall.2, syscalls.2, truncate.2, utimensat.2, write.2, errno.3, exec.3, fclose.3, fexecve.3, fmemopen.3, fopencookie.3, getgrent_r.3, getline.3, getmntent.3, getpw.3, getpwent_r.3, getspnam.3, malloc_info.3, posix_fallocate.3, putgrent.3, shm_open.3, locale.5, proc.5: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-22 23:29:25 +01:00
Michael Kerrisk c4d76cd9ab mmap.2, shmget.2, shm_open.3: SEE ALSO: add memfd_create(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-19 10:35:32 +01:00
Michael Kerrisk 362374628b posix_fallocate.3: Note that posix_fallocate() is implemented using fallocate(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-19 10:35:32 +01:00
Michael Kerrisk 8a11899c69 getpw.3: tfix
Reported-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 23:20:00 +01:00
Michael Kerrisk 9a593da7ff fexecve.3: Rewrite the script+close-on-exec problem as a BUG
Also, add one or two details about this scenario.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 15:07:43 +01:00
Michael Kerrisk 67fc42b56d fexecve.3: The natural idiom when using fexecve() is to use the close-on-exec flag
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 15:07:43 +01:00
Michael Kerrisk 9dabaedf87 fexecve.3: srcfix: Add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 15:05:09 +01:00
Michael Kerrisk 6251424c35 exec.3: SEE ALSO: add execveat(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 15:05:09 +01:00
Michael Kerrisk a940759fc0 execve.2, fexecve.3: SEE ALSO: add execveat(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 15:05:09 +01:00
Michael Kerrisk f3ece15a52 towupper.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 07:56:01 +01:00
Michael Kerrisk 0645c780ad towlower.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 07:55:51 +01:00
Akihiro Motoki bafaef214c printf.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 07:54:02 +01:00
Michael Kerrisk 44517b7b3c getpw.3: Describe return value when 'uid' is not found
Reported-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 07:54:02 +01:00
Carlos O'Donell b5606b276f getpwent_r.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 07:54:01 +01:00
Carlos O'Donell b33e5e8011 getgrent_r.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 07:54:01 +01:00
Michael Kerrisk 363b9dceab getline.3: Consistency fix: use "stream" as name for "FILE *" argument
Inspired by Carlos O'Donell's recent patches.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 07:54:01 +01:00
Michael Kerrisk d41abf5dc6 fopencookie.3: Consistency fix: use "stream" as name for "FILE *" argument
Inspired by Carlos O'Donell's recent patches.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 07:54:01 +01:00
Michael Kerrisk f518495150 fmemopen.3: Consistency fix: use "stream" as name for "FILE *" argument
Inspired by Carlos O'Donell's patches.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 07:53:55 +01:00