Commit Graph

5168 Commits

Author SHA1 Message Date
Michael Kerrisk 1290b94b1c llseek.2: tfix
Reported-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-27 10:16:59 +02:00
Michael Kerrisk 728aff57dd fcntl.2: OFD locks are proposed for inclusion in the next POSIX revision
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-20 16:38:09 +02:00
Zeng Linggang 47f06c7567 utimensat.2: ATTRIBUTES: Note functions that are thread-safe
After research, We think utimensat() and futimens() are thread-safe.
But, there are not markings of utimensat() and futimens() in glibc
document.

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-20 16:13:32 +02:00
Zeng Linggang 288c1a09dd eventfd.2: ATTRIBUTES: Note function that is thread-safe
After research, We think eventfd() is thread-safe. But, there
is not marking of eventfd() in glibc document.

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-20 16:12:43 +02:00
Zeng Linggang 546e17cef9 clock_getres.2: ATTRIBUTES: Note functions that are thread-safe
After research, We think clock_getres(), clock_gettime() and
clock_settime() are thread-safe. But, there are not markings of
clock_getres(), clock_gettime() and clock_settime() in glibc document.

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-20 16:12:36 +02:00
Michael Kerrisk 7626d2ce34 prctl.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-19 09:51:24 +02:00
Michael Kerrisk 6b693d86d3 write.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-15 15:42:10 +02:00
Michal Hocko bbebbb6d56 mmap2: Clarify MAP_POPULATE
David Rientjes has noticed that MAP_POPULATE wording might promise
much more than the kernel actually provides and intend to provide.
The primary usage of the flag is to pre-fault the range. There is
no guarantee that no major faults will happen later on. The pages
might have been reclaimed by the time the process tries to access
them.

Reviewed-by: Eric B Munson <emunson@akamai.com>
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-14 15:34:06 +02:00
Michal Hocko 7e3786bcdc mmap.2: Clarify MAP_LOCKED semantics
MAP_LOCKED had a subtly different semantic from mmap(2)+mlock(2)
since it has been introduced.
mlock(2) fails if the memory range cannot get populated to
guarantee that no future major faults will happen on the range.
mmap(MAP_LOCKED) on the other hand silently succeeds even if
the range was populated only partially.

Fixing this subtle difference in the kernel is rather awkward
because the memory population happens after mm locks have been
dropped and so the cleanup before returning failure (munlock)
could operate on something else than the originally mapped area.

E.g. speculative userspace page fault handler catching SEGV and
doing mmap(fault_addr, MAP_FIXED|MAP_LOCKED) might discard portion
of a racing mmap and lead to lost data. Although it is not clear
whether such a usage would be valid, mmap page doesn't explicitly
describe requirements for threaded applications so we cannot
exclude this possibility.

This patch makes the semantic of MAP_LOCKED explicit and suggests
using mmap + mlock as the only way to guarantee no later major
page faults.

Reviewed-by: Eric B Munson <emunson@akamai.com>
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-14 15:31:11 +02:00
Zeng Linggang 8d53768435 sigaltstack.2: ATTRIBUTES: Note function that is thread-safe
The marking matches glibc marking.
The marking of functions in glibc is:
- sigaltstack: MT-Safe

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-13 17:15:43 +02:00
Zeng Linggang 47e94221ff getrusage.2: ATTRIBUTES: Note function that is thread-safe
The marking matches glibc marking.
The marking of functions in glibc is:
- getrusage: MT-Safe

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-13 17:15:11 +02:00
Zeng Linggang 57ba9747f4 getrlimit.2: ATTRIBUTES: Note functions that are thread-safe
After research, We think prlimit() is thread-safe. But, there
is not marking of prlimit() in glibc document.
getrlimit() and setrlimit() match glibc markings.
- getrlimit: MT-Safe
- setrlimit: MT-Safe
- prlimit:   MT-Safe

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-13 17:15:06 +02:00
Michael Kerrisk d3b019c1b0 send.2: Expand on subtleties of MSG_NOSIGNAL versus ignoring SIGPIPE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-13 13:21:44 +02:00
Michael Kerrisk 19aecb7eb0 send.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-13 13:21:44 +02:00
Michael Kerrisk 630b4cac33 recv.2, send.2: Explain some subtleties of MSG_DONTWAIT versus O_NONBLOCK
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-13 13:21:44 +02:00
Michael Kerrisk b6c261c4db iopl.2: Remove some historical libc5 and glibc 1 details
These details are ancient, and long ago ceased to be relevant.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-12 21:11:17 +02:00
Michael Kerrisk 55bd9495b2 ptrace.2: PTRACE_O_TRACEEXIT clarification
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-12 12:43:48 +02:00
Michael Kerrisk 77548009f5 pread.2, read.2, readv.2, sendfile.2, write.2: Clarify that Linux limits transfers to a maximum of 0x7ffff000 bytes
See https://bugs.debian.org/629994 and
https://bugs.debian.org/630029.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-12 07:07:21 +02:00
Michael Kerrisk 9a12dd5031 pread.2: Rewrite RETURN VALUE section
(Also drop the text on pwrite() returning zero; that seems bogus.)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-12 07:07:21 +02:00
Michael Kerrisk 7b0d1eaa6d readv.2: Remove BUGS heading
The text on mixinf I/O syscalls and stdio is a general point
of behavior. It's not a bug as such.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-12 07:03:02 +02:00
Michael Kerrisk 0b4ac98897 execve.2: srcfix: Add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-11 12:14:54 +02:00
Michael Kerrisk 9f629381c9 open.2, read.2, write.2: Clarify that O_NONBLOCK is a no-op for regular files and block devices
Reported-by: Mike Hayward <hayward@loup.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-11 12:03:43 +02:00
Michael Kerrisk eee5da1663 read.2: Minor fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-11 11:39:38 +02:00
Michael Kerrisk 403b78f89e open.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-11 11:30:00 +02:00
Michael Kerrisk 02906043a4 ioprio_set.2: Document meaning of ioprio==0
Reported-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-11 10:09:05 +02:00
Michael Kerrisk a311ffd05b ioprio_set.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-11 09:39:49 +02:00
Michael Kerrisk 8ebf2cfb42 ioprio_set.2: Minor fix: change 'hda' to 'sda' in examples
These days, we're more likely to see 'sd' than 'hd' disk devices.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-11 09:32:42 +02:00
Michael Kerrisk 7e5d08eb08 ioprio_set.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-11 09:31:25 +02:00
Michael Kerrisk 4965810a6b ioprio_set.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-11 09:26:41 +02:00
Michael Kerrisk eb24aedc69 execve.2: Elaborate on envp/argv as NULL behavior
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-11 09:10:19 +02:00
Michael Kerrisk 097547580e execve.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-11 09:10:09 +02:00
Michael Kerrisk ef5a2800f7 seccomp.2: srcfix
Reported-by: Sam Varshavchik <mrsam@courier-mta.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-08 16:13:42 +02:00
Michael Kerrisk cc5ba920e1 getrandom.2: srcfix
Reported-by: Sam Varshavchik <mrsam@courier-mta.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-08 16:13:02 +02:00
Michael Kerrisk 0722a578ed _exit.2, access.2, brk.2, chmod.2, clone.2, epoll_wait.2, eventfd.2, fork.2, getgroups.2, gethostname.2, getpid.2, getpriority.2, killpg.2, mmap.2, poll.2, posix_fadvise.2, pread.2, ptrace.2, readv.2, sched_setaffinity.2, select.2, seteuid.2, setgid.2, setresuid.2, setreuid.2, setuid.2, sigaction.2, signalfd.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, stat.2, timer_create.2, uname.2, wait.2, wait4.2, mq_notify.3, mq_open.3, sigqueue.3, man-pages.7: Remove "ABI" from "C library/kernel ABI differences" subheadings
The "ABI" doesn't really convey anything significant in
the title. These subsections are about describing differences
between the kernel and (g)libc interfaces.

Reported-by: Andries E. Brouwer <Andries.Brouwer@cwi.nl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-08 13:10:04 +02:00
Michael Kerrisk 8d0418afd0 access.2: tfix + wfix
Reported-by: Andries E. Brouwer <Andries.Brouwer@cwi.nl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-08 11:54:36 +02:00
Michael Kerrisk 86dbf1bbb1 rename.2: srcfix: add Linux kernel commit for RENAME_WHITEOUT
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-07 13:49:05 +02:00
Michael Kerrisk 2236e65b29 sched_setaffinity.2: Add an example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-07 10:37:37 +02:00
Michael Kerrisk d35b5dd343 rename.2: Note that RENAME_NOREPLACE can't be employed with RENAME_EXCHANGE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-07 10:36:39 +02:00
Michael Kerrisk 0ebe7b93fc rename.2: Document RENAME_WHITEOUT
Heavily based on text by Miklos Szeredi.

Cowritten-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-07 10:36:38 +02:00
Michael Kerrisk de332fe886 rename.2: Minor text reworking for EINVAL errors
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-07 10:36:38 +02:00
Michael Kerrisk c9c7821b89 rename.2: Place list of renameat() flags in alphabetical order
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-07 10:36:38 +02:00
Michael Kerrisk ec9a2be0f9 fallocate.2: Tweaks to Namjae Jeon's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-07 10:24:32 +02:00
Namjae Jeon 7da70a01c7 fallocate.2: Document FALLOC_FL_INSERT_RANGE
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-07 09:14:47 +02:00
Michael Kerrisk 5ffdc2fda9 Removed trailing white space at end of lines 2015-05-07 08:30:26 +02:00
Michael Kerrisk 67d2c6873c add_key.2, chown.2, epoll_ctl.2, epoll_wait.2, execve.2, fcntl.2, get_mempolicy.2, getxattr.2, ioctl.2, keyctl.2, listxattr.2, mkdir.2, mknod.2, mmap.2, msync.2, nfsservctl.2, open.2, prctl.2, removexattr.2, request_key.2, sendfile.2, set_mempolicy.2, setxattr.2, shmget.2, shutdown.2, sigaction.2, syslog.2, truncate.2, umask.2, CPU_SET.3, atexit.3, bsearch.3, cmsg.3, err.3, gethostid.3, getmntent.3, getopt.3, iconv_close.3, inet_ntop.3, longjmp.3, lsearch.3, mcheck.3, on_exit.3, putpwent.3, regex.3, resolver.3, setbuf.3, setjmp.3, setlocale.3, setlogmask.3, sleep.3, strsignal.3, sysconf.3, undocumented.3, tty_ioctl.4, proc.5, resolv.conf.5, tzfile.5, aio.7, bootparam.7, capabilities.7, fanotify.7, inotify.7, ip.7, packet.7, pthreads.7, raw.7, signal.7, socket.7, unix.7, ld.so.8, nscd.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-07 08:26:32 +02:00
Brice Goglin 856778162b get_mempolicy.2, set_mempolicy: Policy is per thread, not per process
set/get_mempolicy manpages say that the memory allocation
policy is per process while reading the code and testing shows
that it's actually per thread.  Here's a quick fix, which may
need to be improved to better explain that we're allocating
in the context of a thread within a process address space.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-06 20:37:34 +02:00
Michael Kerrisk 320f8a8ec9 open.2: BUGS: O_CREAT | O_DIRECTORY succeeds if pathname does not exist
See http://www.openwall.com/lists/oss-security/2014/11/26/10
and http://thread.gmane.org/gmane.linux.file-systems/90997
    Subject: O_CREAT|O_DIRECTORY on nonexisting file with ext4
             not posix-compliant
    Newsgroups: gmane.linux.file-systems
    Date: 2014-12-15 17:39:09 GMT
and https://lkml.org/lkml/2005/9/23/80
    Subject: [PATCH] open: O_DIRECTORY and O_CREAT together should fail
    From:    Miklos Szeredi <>
    Date:    Fri, 23 Sep 2005 16:45:04 +0200

Reported-by: NeilBrown <neilb@suse.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-06 18:31:49 +02:00
Michael Kerrisk 70b53bc047 stat.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-06 17:58:39 +02:00
Michael Kerrisk 97d5b76276 open.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-06 17:57:32 +02:00
Michael Kerrisk 6ca52c17a9 shmget.2: Document SHM_HUGE_2MB, SHM_HUGE_1GB, and SHM_HUGE_SHIFT
Reported-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-05-06 17:41:21 +02:00