Commit Graph

15438 Commits

Author SHA1 Message Date
Michael Kerrisk 6550b8275b readdir.3: Near complete restructuring of the page and add some further details
The mixture of information across DESCRIPTION and NOTES did
not lend itself to easy reading...

While we're at it, add some missing details as well.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-02 12:30:32 +01:00
Michael Kerrisk df7a8fc91e readdir.3: Explain how to distinguish end of stream from an error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-02 08:41:26 +01:00
Michael Kerrisk 59ac6f2f1a socket.7: Reword discussion of SO_LOCK_FILTER use case
Reported-by: Vincent Bernat <bernat@luffy.cx>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 21:26:04 +01:00
Michael Kerrisk bd8a7ca2fc socket.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 21:16:46 +01:00
Michael Kerrisk 96604453fd readdir.3, readdir_r.3: Split readdir_r() content into separate page
As suggested by Florian Weimer:

    It may make sense to move this documentation to a separate
    manual page, specific to readdir_r.  This will keep the
    readdir() documentation nice and crisp.  Most programmers
    will never have to consult all these details.

Reported-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 21:07:01 +01:00
Michael Kerrisk c48f13805c readdir.3: Remove misleading code example using pathconf()
As noted by Florian:

    The kernel does not return valid values for _PC_NAME_MAX and
    some file systems (such as CIFS, and CD-ROMs with Joliet
    extensions once a kernel bug is fixed).  The CIFS limit is
    somewhere around 765, and not 255 as reported by the kernel.
    If I recall correctly, Windows SMB servers can actually
    exceed the 255 byte limit.  The reason is that Windows NTFS
    has a limit based on 16-bit UCS-2 characters, and after
    UTF-8 conversion, the maximum length is more than 255 bytes.

Reported-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:31:56 +01:00
Michael Kerrisk 0c52f6d623 readdir.3: Explain why readdir_r() is deprecated and readdir() is preferred
Based on Florian Weimer's text that was added to the glibc manual;
relicensed for use in this man page by permission of Florian.
See http://www.austingroupbugs.net/view.php?id=696
and https://sourceware.org/bugzilla/show_bug.cgi?id=14699

Cowritten-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:25:51 +01:00
Michael Kerrisk cff459dea2 kill.2, sigaction.2, sigpending.2, sigprocmask.2, sigsuspend.2, ctermid.3, ferror.3, fopen.3, getaddrinfo.3, getnameinfo.3, longjmp.3, rand.3, setjmp.3, sigsetops.3, sigwait.3, tzset.3: Simply FTM requirements
_XOPEN_SOURCE implies _POSIX_C_SOURCE >=2, so simplify FTM
requirements in various pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:05 +01:00
Michael Kerrisk d59161f912 ctime.3, ffs.3, finite.3, flockfile.3, gethostbyname.3, getnameinfo.3, getw.3, insque.3, isalpha.3, popen.3, printf.3, siginterrupt.3, strdup.3, strtok.3, toascii.3, tzset.3, unlocked_stdio.3: Update FTM requirements (mostly _DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:05 +01:00
Michael Kerrisk 97ff735155 tmpnam.3: Remove mention od _BSD_SOURCE and _SVID_SOURCE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 6b8b0e500c strtok.3: grfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 38d9e98ea3 feature_test_macros.7: Give an early hint about some macros being defined by default
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 9db90c7cc9 getgrent.3, getgrnam.3, getpwent.3, getpwnam.3: Updaye FTM requirements (mostly _DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk c1016e8767 kill.2, sigaction.2, sigpending.2, sigprocmask.2, sigsuspend.2, ctermid.3, ctime.3, ferror.3, flockfile.3, fopen.3, getaddrinfo.3, getgrnam.3, getnameinfo.3, getpwnam.3, rand.3, sigsetops.3, sigwait.3, strtok.3, tzset.3, unlocked_stdio.3, feature_test_macros.7: Remove mention of the obsolete _POSIX_SOURCE macro from SYNOPSIS
_POSIX_SOURCE was a POSIX.1-1990 creation that was soon made
obsolete bu _POSIX_C_SOURCE. Retaining mention of it
in the feature test macro requirements section of the
SYNOPSIS doesn't contain important information, and may
mislead readers into actually trying to use this macro.
A few mentions of it a maintained in a some pages where
defining _POSIX_SOURCE inhibits some behavior.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk c4a256e267 strerror.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk a30128b4cc dirfd.3, readdir.3, scandir.3, seekdir.3, telldir.3: Update FTM requirements (mostly _DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 2b1b042487 a64l.3, atoi.3, clearenv.3, drand48.3, drand48_r.3, ecvt.3, ecvt_r.3, gcvt.3, mkstemp.3, mktemp.3, posix_memalign.3, putenv.3, random.3, random_r.3, realpath.3, setenv.3, strtol.3, strtoul.3: Update FTM requirements (mostly _DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 6e0869f758 getcwd.3, getdtablesize.3, getpass.3, lockf.3, ualarm.3, usleep.3: Update FTM requirements (mainly _DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk f8619b6a26 killpg.2, mknod.2, mmap.2, nice.2, readlink.2, seteuid.2, setpgid.2, setreuid.2, sigaltstack.2, symlink.2, sync.2, truncate.2, vfork.2, wait.2: Update FTM requirements (mainly _DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk f8e7625cad signal.2: Update FTM requirements (_DEFAULT_SOURCE)
Also remove redundant text covering FTM details that
are already provided in feature_test_macros(7).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 6b0f5f5c4c fcntl.2: Remove mention of _BSD_SOURCE to get definition of F_SETOQN/F_GETOWN
This usage went away in glibc 2.20, and the simplest remedy
is just to omit mention of it.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 1b5de130aa chroot.2: Update FTM requirements
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk bc3e200eb3 chown.2: Update FTM requirements
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 7943641180 chmod.2: Update FTM requirements
There have been a number of changes in recent glibc versions

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 4f71ba5dbd clone.2, unshare.2: Remove mention of _BSD_SOURCE and _SVID_SOURCE
The right way to expose declarations for these Linux-specific
system calls was always _GNU_SOURCE. Mentioning the historical
use of _BSD_SOURCE and _SVID_SOURCE just clouds the issue.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk e0a68e13d9 acosh.3, asinh.3, atanh.3: Update FTM requirements (_DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 827cdae3f1 _exit.2, abs.3, acos.3, acosh.3, asin.3, asinh.3, atan.3, atan2.3, atanh.3, atoi.3, cbrt.3, ceil.3, copysign.3, cos.3, cosh.3, div.3, erf.3, erfc.3, exp.3, exp2.3, expm1.3, fabs.3, fdim.3, finite.3, floor.3, fma.3, fmax.3, fmin.3, fmod.3, fpclassify.3, frexp.3, fwide.3, hypot.3, ilogb.3, isalpha.3, isgreater.3, iswblank.3, ldexp.3, lgamma.3, log.3, log10.3, log1p.3, log2.3, logb.3, lrint.3, lround.3, modf.3, nan.3, nextafter.3, pow.3, printf.3, remainder.3, remquo.3, rint.3, round.3, scalbln.3, scanf.3, signbit.3, sin.3, sinh.3, sqrt.3, strtod.3, strtol.3, strtoul.3, tan.3, tanh.3, tgamma.3, trunc.3, wprintf.3: Remove "or 'cc -std=c99'" from SYNOPSIS
Under the FTM requirements all of these pages document the
requirement for _ISOC99_SOURCE. And feature_test_macros(7) now
documents that "cc -std=c99" produces the same effect as defining
_ISOC99_SOURCE. So, all of these pages don't additionally need
to specify "or 'cc -std=c99'" under the FTM requirements
in the SYNOPSIS. Removing that redundant text also simplifies
the SYNOPSIS a little.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 50d844a9f1 feature_test_macros.7: Note effects of "cc -std=c99" and "cc -std=c11"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk cd2d5ec163 exp2.3, finite.3, fwide.3, log2.3, nextafter.3, printf.3, rint.3, wprintf.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 636ed4d58d acosh.3, asinh.3, atanh.3, cbrt.3, erf.3, erfc.3, expm1.3, fpclassify.3, gamma.3, hypot.3, ilogb.3, j0.3, lgamma.3, log1p.3, logb.3, matherr.3, nextafter.3, remainder.3, rint.3, scalb.3, scalbln.3, significand.3, y0.3: Update FTM requirements (_DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk f04d68ba16 feature_test_macros.7: Clarify some _ISOC99_SOURCE / _DEFAULT_SOURCE details
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk e9d91bcf4c acos.3, asin.3, atan.3, atan2.3, ceil.3, copysign.3, cos.3, cosh.3, exp.3, fabs.3, floor.3, fmod.3, frexp.3, ldexp.3, log.3, log10.3, modf.3, pow.3, sin.3, sinh.3, sqrt.3, tan.3, tanh.3: Update FTM requirements (_DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk 16347c676c chdir.2: Update FTM requirements
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:04 +01:00
Michael Kerrisk c8fab0f00e getpagesize.2: Update FTM requirements (_DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk a48088b0e6 fsync.2: Update FTM requirements
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk b68a13bc33 fsync.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk aa573adabf dirfd.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk 51c612fb9f getgroups.2, gettimeofday.2, mincore.2, readv.2, stime.2, wait4.2, addseverity.3, adjtime.3, cfree.3, dysize.3, fgetgrent.3, fgetpwent.3, futimes.3, getdirentries.3, getgrent_r.3, getgrouplist.3, getmntent.3, getnetent_r.3, getprotoent_r.3, getpwent_r.3, getrpcent_r.3, getservent_r.3, getspnam.3, gsignal.3, initgroups.3, mkdtemp.3, on_exit.3, perror.3, psignal.3, putpwent.3, rcmd.3, rpmatch.3, setbuf.3, setnetgrent.3, sigvec.3, strsep.3, syslog.3, tempnam.3, termios.3, timegm.3, timeradd.3: Update FTM requirements (_DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk 3dd87b7c99 setjmp.3: Remove reference to obsolete _XOPEN_SOURCE_EXTENDED
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk b40ec4cbf8 ttyslot.3: Update FTM requirements (_DEFAULT_SOURCE)
And remove mention of obsolete _XOPEN_SOURCE_EXTENDED

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk 52d1e2b247 setpgid.2: Correct/simplify FTM requirements for BSD setpgrp() and getpgrp()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk 1e92200fa9 feature_test_macros.7: Note that man pages don't mention _XOPEN_SOURCE_EXTENDED
As per previous commit, mention of _XOPEN_SOURCE_EXTENDED
has generally been removed from the man pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk 49d2e09456 feature_test_macros.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk cf7fa0a179 brk.2, chdir.2, chmod.2, chown.2, chroot.2, getpagesize.2, getsid.2, killpg.2, mknod.2, readlink.2, setpgid.2, setreuid.2, sigaltstack.2, stat.2, symlink.2, sync.2, truncate.2, vfork.2, wait.2, wait4.2, a64l.3, acosh.3, asinh.3, atanh.3, cbrt.3, ecvt.3, expm1.3, gcvt.3, getcwd.3, getdate.3, getdtablesize.3, getgrent.3, gethostid.3, getpass.3, getpwent.3, getsubopt.3, ilogb.3, insque.3, lockf.3, log1p.3, logb.3, mkstemp.3, mktemp.3, nextafter.3, posix_memalign.3, random.3, realpath.3, remainder.3, rint.3, scalb.3, siginterrupt.3, sigset.3, strdup.3, ualarm.3, usleep.3: Remove references to _XOPEN_SOURCE_EXTENDED in SYNOPSIS
_XOPEN_SOURCE_EXTENDED is obsolete (it existed in SUSv1, but not
subsequent standards). _XOPEN_SOURCE >= 500 produces the same
effects as (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED). Modifying
the SYNOPSIS of various ages that contain:

    _XOPEN_SOURCE\ >=\ 500 ||
        _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED

to just:

    _XOPEN_SOURCE\ >=\ 500

This has the following benefits:

a) Simplifying the SYNOPSIS by removing ancient
   historical information.

b) Preventing users from being misled into using
   _XOPEN_SOURCE_EXTENDED in new source code.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk 7f0ec8eed6 endian.3, getloadavg.3, getutent.3, inet.3, makedev.3, rexec.3: Update FTM requirements (_DEFAULT_SOURCE)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk 38e3518901 adjtimex.2: Remove FTM requirements
It seems that adjtimex() never needed _BSD_SOURCE (and my
earlier commit 5918743bc8 was simply a blunder.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk e1d0532862 scandir.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk f125c76932 feature_test_macros.7: Add a summary of some FTM key points
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk b0da7b8b76 access.2, chmod.2, chown.2, link.2, mkdir.2, open.2, readlink.2, rename.2, stat.2, symlink.2, unlink.2, utimensat.2, vfork.2, dirfd.3, fexecve.3, ffs.3, fmemopen.3, getcwd.3, gethostbyname.3, getline.3, mbsnrtowcs.3, mkdtemp.3, mkfifo.3, opendir.3, printf.3, psignal.3, qecvt.3, scandir.3, stpcpy.3, stpncpy.3, strdup.3, strnlen.3, strsignal.3, ualarm.3, usleep.3, wcpcpy.3, wcpncpy.3, wcscasecmp.3, wcsdup.3, wcsncasecmp.3, wcsnlen.3, wcsnrtombs.3: Simply FTM requirements
Looking at <features.h> (or feature_test_macros(7)), one can
see that when _XOPEN_SOURCE is defined with the value 700
(or greater), then _POSIX_C_SOURCE is defined with the value
200809L (or greater). Therefore, terms in the man pages such as

    _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L

can be simpified to:

    _POSIX_C_SOURCE\ >=\ 200809L

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00
Michael Kerrisk d1473a830f feature_test_macros.7: Clarify that _XOPEN_SOURCE_EXTENDED is obsolete
Since SUSv2, _XOPEN_SOURCE_EXTENDED is no longer specified
in the standard.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-03-01 20:01:03 +01:00