Commit Graph

16310 Commits

Author SHA1 Message Date
HuKeping 794d8db3ab rtnetlink.3: tfix
Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-09-09 07:23:18 +01:00
Michael Kerrisk 5e43063bdd readv.2: Clarify that RWF_DSYNC and RWF_SYNC apply only to data being written
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-09-04 16:52:08 +12:00
Michael Kerrisk dae86017d7 readv.2: Document the pwritev2() RWF_SYNC and RWF_DSYNC flags
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-09-04 16:46:49 +12:00
Michael Kerrisk 5c3bbffbb0 rename.2: Minor wording fix
The meaning of "when overwriting" is not clear. I believe what is
meant is that when an existing 'newpath' is replaced. However, we
can convey that meaning by eliding this text with the preceding
paragraph, so this patch does that.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-09-04 16:44:47 +12:00
Michael Kerrisk 84a3d76675 rename.2: Relocate some text text
Relocate text noting that there may be a window when 'oldpath' and
'newpath' refer to the same file. Logically, this text appears to
belong near the text noting that an existing 'newpath' will be
atomically replaced.  (In ancient versions of the page, these two
pieces of text were closer together.)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-09-04 16:43:02 +12:00
Michael Kerrisk ae01f2b58b rename.2: Clarify that ERRORS may cause rename to fail (not to be nonatomic)
The existing wording suggests that there are ERRORS that may cause
the operation to be nonatomic. The point is of course that there
are various restrictions on rename operations that may cause the
operation to fail.

Reported-by: Tim Savannah <kata198@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-09-04 16:43:02 +12:00
Michael Kerrisk cbac502be2 mlock.2: Minor tweaks to Sebastian Andrzej Siewior's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-31 07:23:08 +12:00
Sebastian Andrzej Siewior fb08a0954e mlock.2: Document that fork() after mlock() may be a bad idea in a RT process
fork() will remove the write PTE bit from the page table on each
VMA which will be copied via COW. As such, the memory is available
but marked read only in the page table and will fault on write
access.  This renders the previous mlock() operation almost
useless because in a multithreaded application a realtime thread
may block on mmap_sem while a thread with low priority is holding
the mmap_sem (for instance because it is allocating memory which
needs to be mapped in).

There is actually nothing we can do to mitigate the outcome. We could
add a warning to the kernel for people that are not yet aware of the
updated documentation.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2016-08-31 07:23:08 +12:00
Michael Kerrisk 46305699f7 pthread_join.3: Note that the caller might do clean up after joining with a thread
Reported-by: Mats Wichmann <mats@wichmann.us>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-31 07:23:08 +12:00
Michael Kerrisk 1f73bfaf6e strverscmp.3: Add an example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-31 07:23:03 +12:00
Michael Kerrisk d695a48cdf stat.2: Tweak discussion of 'st_size' for /proc and /sys files
As Mats points out, there appear to be no (or almost no) files
under /proc and /sys for which 'st_size' is meaningful.
(mtk: verified via some scripting over these directories.)

Reported-by: Mats Wichmann <mats@wichmann.us>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-31 07:19:00 +12:00
Michael Kerrisk 919b0ce050 pthread_join.3: Clarify use of 'retval' pointer
Reported-by: 王守堰 <wangshouyan@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-29 09:56:47 +12:00
Michael Kerrisk 9dbc4adbce stat.2: Improve discussion of 'st_size' for /proc and /sys files
Reported-by: Ursache Vladimir <f35f22fan@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-29 08:47:39 +12:00
Ruben Kerkhof 370f8e34c4 epoll_ctl.2: tfix 2016-08-29 07:26:46 +12:00
Ruben Kerkhof 7bf58d66ac epoll_ctl.2: tfix 2016-08-29 07:25:55 +12:00
Michael Kerrisk 6c79a020fa sigprocmask.2: Minor fixes to Keno Fischer's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-28 17:48:12 +12:00
Keno Fischer 86d5ed87d3 sigprocmask.2: Expand/clarify libc/kernel sigset_t difference
Expand and clarify libc/kernel sigset_t differences.  Also move
up the signature for rt_sigprocmask, similar to the way this is
done in clone.2.

Due to the history of sigprocmask, there are various notions of
what sigset_t refers to. This attempts to clarify the man page,
by giving the major instances different names:

- sigset_t is the glibc sigset_t (1024 bits)
- kernel_sigset_t is the kernel's sigset_t (64 bits)
- old_kernel_sigset_t is the pre-rt kernel's sigset_t (32 bits)

and explaining their difference in the NOTES. Even though the
sources do not refer to the various sigset_t's by these names, I
think it is important to be explicit, esp since sizeof(sigset_t)
would give an incorrect value for `sigsetsize` if written in a
source file that includes the libc headers.

Lastly, move the note on an incorrect `sigsetsize` causing
EINVAL up to the ERRORS section, so everything is in one place.
2016-08-28 17:42:52 +12:00
Ruben Kerkhof 48bafe7c02 readdir_r(3): tfix: Fix reference to readdir(3) 2016-08-28 16:38:31 +12:00
Michael Kerrisk 49dba87f5c clone.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-24 11:47:52 +12:00
Michael Kerrisk db8ba2b415 clone.2: Make the implications of CLONE_FILES more explicit
If CLONE_FILES is not set, the duplicated FDs nevertheless share
file offset and status flags via the open file description.

Reported-by: Elliott Hughes <enh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-24 11:47:45 +12:00
Michael Kerrisk 6a459f6fee fcntl.2: Minor wording fix for F_DUPFD
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-24 11:29:35 +12:00
Michael Kerrisk 4529738e46 accept.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-23 19:45:16 +12:00
Michael Kerrisk dc1f897234 ip.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-23 18:26:12 +12:00
Michael Kerrisk 173fa792d5 ip.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-23 18:21:03 +12:00
Michael Kerrisk a2bb780cf0 ddp.7: grfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-23 16:46:20 +12:00
Michael Kerrisk bb05e249ae ddp.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-23 16:44:24 +12:00
Michael Kerrisk c1aac5e301 fifo.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-23 10:27:00 +12:00
Michael Kerrisk a376f4f068 termcap.5: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-23 10:24:05 +12:00
Michael Kerrisk ccdf8bc04f accept.2: Demote discussion of DECNet to NOTES
DECNet ceased to be important long ago...

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-23 10:03:31 +12:00
Michael Kerrisk cb1bcdf28c accept.2: Mention epoll(7) alongside poll()/select()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-23 10:01:58 +12:00
Michael Kerrisk 692b4bcca6 fanotify_init.2: Update BUGS information
Patch 0b37e097a648aa71d4db1ad108001e95b69a2da4 was included
in Linux 3.18.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2016-08-22 07:18:24 +12:00
Michael Kerrisk cc6e4bf0cf readlink.2: Make example program handle links that report a size of zero
Some "magic" symlinks created by the kernel (e.g., those under
/proc and /sys) report 'st_size' as zero. Modify the example
program to handle that possibility.

Reported-by: Ursache Vladimir <f35f22fan@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-20 15:27:13 +12:00
Michael Kerrisk e9979dff7c readlink.2: Emphasize that truncation of returned buffer generates no error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-20 15:02:06 +12:00
Michael Kerrisk 1a0dff18b2 capabilities.7: Minor tweaks to Matthew Saunders' patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-20 11:37:42 +12:00
Michael Kerrisk 1f601b1c28 capabilities.7: Add note about nosuid to file capabilities section 2016-08-20 11:31:26 +12:00
Michael Kerrisk efcf47adbd makedev.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-18 09:59:24 +12:00
David Turner 41185b1261 cpuset.7: tfix 2016-08-17 17:07:32 +12:00
Michael Kerrisk bf525e9050 mmap.2: Small improvement to description of MAP_SHARED
See https://sourceware.org/bugzilla/show_bug.cgi?id=6887

Reported-by: Siward de Groot <siward@wanadoo.nl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-17 08:09:28 +12:00
Michael Kerrisk 7b032b2398 open.2: Minor layout fix in ERRORS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-17 08:09:28 +12:00
Michael Kerrisk 61775a254e fifo.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-17 08:09:28 +12:00
Michael Kerrisk f62ddda8a4 fcntl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-17 08:09:28 +12:00
Michael Kerrisk aa30354a3b select_tut.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-12 07:14:42 +12:00
Michael Kerrisk a686506533 ptrace.2: ffix
Reported-by: Sam Varshavchik <mrsam@courier-mta.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-12 07:14:42 +12:00
Peter Wu 3c3d1f83f9 select_tut.2: fix issues in example
Avoid closing cfd if it is -1. Initialize buf1_avail, etc. to avoid
uninitialized memory access in the event that accept() fails. Remove
redundant setting of nfds. Fix tabs with spaces.

Do not try to read/write from/to file descriptors once an existing
connection is overwritten, the select() states are stale now.
Avoid writing zero bytes from the buffer and then closing the fd.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2016-08-12 07:14:42 +12:00
Ray Bellis 519303a6a4 resolver.3: Correct arguments to res_ninit(res_state statep)
The man page for res_ninit() incorrectly says that it takes no
parameters, when in fact (and indeed according to the same page
further down) it has to take a res_state parameter.
2016-08-12 07:14:42 +12:00
Michael Kerrisk a9672faabc fmemopen.3: Remove bogus suggestion to use setbuffer()
As Rich Felker comments:

    The stdio buffer associated with the fmemopen-obtained FILE,
    and the output memory buffer into which it's writing, are
    conceptually distinct entities, and there is no reason to
    expect reasonable results if you modify the contents of a
    setvbuf-associated buffer through other means while it's
    associated with a FILE.

See http://stackoverflow.com/questions/38854163/using-rewind-on-a-file-opened-with-fmemopen

Reported-by: Rich Felker <dalias@libc.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-12 07:14:42 +12:00
Jann Horn 423cb9f7ff mmap.2: Describe treatment of 'offset' for MAP_ANONYMOUS
The manpage claimed that the offset argument is ignored, and when
I interpreted that as "I don't need to set that register when
doing the syscall", I got failures. I was able to spot two reasons
for that:

What I probably ran into:
At least on x86-64, sys_mmap (in arch/x86/kernel/sys_x86_64.c)
always checks that the offset is page-aligned, even for
MAP_ANONYMOUS.

Another one, could probably trigger on 32-bit x86:
In do_mmap(), there is a check to ensure that pgoff together with
the allocation length won't cause an overflow, even for
MAP_ANONYMOUS.

Document that userspace should pass in zero, since that's
probably what everyone is doing already. (It would also be
possible to describe the constraints on the offset more
carefully, but zero works, and nobody should need to pass in
anything else.)

Signed-off-by: Jann Horn <jann@thejh.net>
2016-08-12 07:14:42 +12:00
Michael Kerrisk 1bceaaee94 glob.7: Clarify that syntactically incorrect patterns are left unchanged
Reported-by: Arnaud Gaillard <arnaud.mgaillard@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-12 07:14:42 +12:00
Michael Kerrisk b6264ec7cd syscall.2: Eliminate groff "cannot adjust line" warnings
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-12 07:14:42 +12:00
Michael Kerrisk 2a69e8175e ascii.7: Eliminate groff "cannot adjust line" warnings
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-12 07:14:42 +12:00