Commit Graph

5935 Commits

Author SHA1 Message Date
Michael Kerrisk 5bb9aa4e0c select_tut.2: Better variable names in example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-03 14:37:40 +01:00
Michael Kerrisk f145f66700 select_tut.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-03 14:18:21 +01:00
Michael Kerrisk 887f19e8a1 select.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-03 14:16:00 +01:00
Michael Kerrisk 455f50e98b select_tut.2: Some readability fixes to example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-03 14:08:29 +01:00
Michael Kerrisk 24a31d632b accept.2, bind.2, connect.2, getpeername.2, getsockname.2, recv.2, recvmmsg.2, select_tut.2, send.2, sendmmsg.2, getaddrinfo.3, getnameinfo.3, epoll.7, unix.7: Use consistent argument/variable names for socket addresses and lengths
As noted by Carlos, there's quite a bit of inconsistency across
pages. Use 'addr' and 'addrlen' consistently in variables and
function arguments.

Cowritten-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-03 14:08:29 +01:00
Michael Kerrisk 787dd4ad3a membarrier.2, crypt.3, dladdr.3, duplocale.3, fmemopen.3, gethostbyname.3, mallopt.3, newlocale.3, resolver.3, sigsetops.3, strfmon.3, tzset.3, console_ioctl.4, lirc.4, loop.4, vcs.4, dir_colors.5, locale.5, proc.5, tzfile.5, attributes.7, bootparam.7, capabilities.7, feature_test_macros.7, icmp.7, man-pages.7, netlink.7, path_resolution.7, pipe.7, socket.7, unix.7, vdso.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-03 09:14:22 +01:00
Michael Kerrisk def04e1ccf chown.2, futex.2, membarrier.2, memfd_create.2, mount.2, msgop.2, open.2, open_by_handle_at.2, perf_event_open.2, readv.2, sched_setscheduler.2, syslog.2, basename.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-03 08:46:16 +01:00
Michael Kerrisk e6a05bfff2 clock_getres.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-03 08:36:41 +01:00
Michael Kerrisk 9088de13ba capget.2, chown.2, chroot.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-03 08:36:32 +01:00
Michael Kerrisk 122502e824 bind.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-03 08:34:02 +01:00
Jakub Wilk ed1819cf3e futex.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2016-02-03 08:27:03 +01:00
Jakub Wilk 2050c09881 perf_event_open.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2016-02-03 08:26:34 +01:00
Jakub Wilk 3a1de8ba24 kexec_load.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2016-02-03 08:26:01 +01:00
Michael Kerrisk 8400413301 msgop.2: tfix
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-03 08:24:17 +01:00
Michael Kerrisk 6c3453059b select.2: Add details on the glibc fixed-size fd_set limitation
No modern application should use select() on Linux.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-01 15:21:54 +01:00
Nikos Mavrogiannopoulos 6b6e918550 select.2: Mention the 'fd_set' size limitation early and refer to poll(2)
Change this because of the serious limitation of select()
imposing a limit on the range of file descriptors that can
be monitored. This is currently mentioned too late in the
documentation (in the NOTES section). The man page should
warn early and refer to poll(2) as soon as possible.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-02-01 15:21:54 +01:00
Michael Kerrisk 555c23c278 personality.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-31 16:34:02 +01:00
Michael Kerrisk 2d41eca319 personality.2: Greatly expand, to add descriptions of personality domains.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-30 17:31:14 +01:00
Michael Kerrisk 6d8e9b7e76 readv.2: wrcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-28 21:48:45 +01:00
Michael Kerrisk 34d4e61def accept.2, perf_event_open.2, unlink.2, lirc.4, proc.5, inotify.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-28 10:44:01 +01:00
Michael Kerrisk 2bea5d44a5 copy_file_range.2: Add notes on copy_on_write() filesystem optimizations
Based on Anna Schumaker's noted in the initial commit for
this man page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-27 09:10:32 +01:00
Michael Kerrisk a5918afa92 syscalls.2: Add copy_file_range(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-27 09:00:36 +01:00
Michael Kerrisk 9876bc24d0 sendfile.2: SEE ALSO: add copy_file_range(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:51:28 +01:00
Michael Kerrisk d1de085084 copy_file_range.2: EXAMPLE: remove unused variable from example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:42:20 +01:00
Michael Kerrisk b4fe696c8a copy_file_range.2: NOTES: expand details on the use of lseek()
Mention SEEK_DATA and SEEK_HOLE explicitly.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:42:20 +01:00
Michael Kerrisk 4cfafd7910 copy_file_range.2: ERRORS: clarify EXDEV description
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:42:20 +01:00
Michael Kerrisk f0558db88d copy_file_range.2: ERRORS: clarify EINVAL O_APPEND description
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:42:19 +01:00
Michael Kerrisk ee43ffde93 copy_file_range.2: Minor fixes to Anna's new page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:42:19 +01:00
Anna Schumaker 903b48079c copy_file_range.2: New page documenting copy_file_range()
copy_file_range() is a new system call for copying ranges of data
completely in the kernel.  This gives filesystems an opportunity to
implement some kind of "copy acceleration", such as reflinks or
server-side-copy (in the case of NFS).

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:15:24 +01:00
Michael Kerrisk c72249c562 fork.2, read.2, sendfile.2, splice.2, write.2, aio_read.3, aio_write.3, proc.5: Wording fix: "current file offset" ==> "file offset"
"File offset" is the preferred POSIX terminology.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:13:47 +01:00
Michael Kerrisk f180e30bc2 lseek.2: wfix ("open file description")
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:08:39 +01:00
Michael Kerrisk e2b89c5c8c lseek.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:06:41 +01:00
Michael Kerrisk 930fa2cd5a llseek.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:05:32 +01:00
Michael Kerrisk 14a9ad4952 llseek.2, lseek.2, readahead.2: Wording fix: use "open file description" rather than "open file"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:02:21 +01:00
Michael Kerrisk 162ce82786 llseek.2: SEE ALSO: add open(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-26 10:02:21 +01:00
Jakub Wilk 1a6de32849 perfmonctl.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-25 14:33:57 +01:00
Joe Stein f0e9ccbc88 keyctl.2: tfix
Signed-off-by: Joe Stein <joeaarons@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-25 14:32:09 +01:00
Michael Kerrisk e6659f737e execve.2: Add reference to ld-linux.so(8)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-21 00:21:24 +01:00
Michael Kerrisk 36f8fb2bcd wait.2, wait4.2: Rename the "status" argument to "wstatus"
The fact that exit(3)/_exit(2) has an argument called
"status" and the same name is used in the arguments to the
wait*() calls can a little too easily lead the user into
thinking that the two arguments hold the same information,
when of course they don't. So, use a different name
for the argument of the wait*() functions, to reduce
the chances of such confusion.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-20 22:14:00 +01:00
Heinrich Schuchardt 90425b93fc recv.2: Equivalence to read
Describe the recv(2)-read(2) and the recvfrom(2)-recv(2)
equivalences for zero-valued arguments.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-16 12:08:55 +01:00
Jakub Wilk ea84b0fd6b nanosleep.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-16 11:20:12 +01:00
Michael Kerrisk e6aa1ec849 execve.2: SEE ALSO: add system(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-16 10:37:50 +01:00
Michael Kerrisk ef2244feb9 recv.2: MSG_WAITALL has no effect for datgram sockets
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-16 10:10:56 +01:00
Michael Kerrisk 972748d883 readlink.2: Clarify EINVAL error description
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-12 10:10:35 +01:00
Michael Kerrisk 4a6f17b57a sched_setattr.2: EPERM depends on affinity mask of target thread, not calling thread
Reported-by: Akihiro Suda <suda.kyoto@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-08 21:26:50 +01:00
Jakub Wilk 67c67ff26b futex.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-08 17:26:15 +01:00
Michael Kerrisk 1a3c3468bd ptrace.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-08 17:24:58 +01:00
Jakub Wilk 851eae74ca ptrace.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-08 17:24:20 +01:00
Michael Kerrisk a1dc786b3d bind.2: Improve description of ENOENT error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-01 13:19:01 +01:00
Michael Kerrisk 2a70e42b66 chdir.2: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-01 13:17:29 +01:00
Michael Kerrisk bb14af394e clock_nanosleep.2, fallocate.2, nanosleep.2, request_key.2, sigsuspend.2, statfs.2, getgrent.3, getgrnam.3, getpwent.3, getpwnam.3, lio_listio.3, statvfs.3, tmpfile.3, ualarm.3: ERRORS: add reference to signal(7) in description of EINTR
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-01 13:15:06 +01:00
Michael Kerrisk 3aa743158f truncate.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-01 13:02:36 +01:00
Michael Kerrisk a72a617408 execve.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-01 13:00:35 +01:00
Michael Kerrisk d9cb0d7d3f Various pages: Word "descriptor" more precisely
Use either "file descriptor" or message queue descriptor".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-01 12:29:37 +01:00
Michael Kerrisk 0fa890e0d8 stat.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-01 12:28:38 +01:00
Michael Kerrisk d60d564db8 connect.2: ERRORS: improve EBADF description
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-01 12:28:38 +01:00
Michael Kerrisk 298998880f socket.2: Minor wording improvement
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-01 12:28:37 +01:00
Michael Kerrisk ad3450b92c chown.2: ERRORS: improve EBADF description
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-01 12:28:37 +01:00
Michael Kerrisk 3ad7769474 accept.2: ERRORS: improve description for EBADF
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-01-01 12:28:37 +01:00
Mike Frysinger 3438c51640 syscall(2): ffix
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 20:37:16 +01:00
Jakub Wilk 835b2b2c27 fcntl.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 20:36:19 +01:00
Jakub Wilk f6615c426b futex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 20:35:30 +01:00
Heinrich Schuchardt eb56b04bcc ioctl_list.2: Transfer structure (wireless.h IOCTLs)
The sole parameter to be passed to the wireless.h IOCTLs is
of type struct iwreq *.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 20:34:13 +01:00
Michael Kerrisk cd175805de futex.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 13:57:02 +01:00
Heinrich Schuchardt 938bcc0824 ioctl_list.2: Include uapi/linux/wireless.h
Add the list of wireless IOCTLs.

We should later add a page ioctl_wireless.2 decribing the usage.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 11:57:28 +01:00
Heinrich Schuchardt 767ffad326 ioctl_list.2: Path to sockios.h
sockios.h is now in include/uapi

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 11:53:41 +01:00
Heinrich Schuchardt a3b9b5da15 ioctl_list.2: Add reference to netdevice.7
netdevice.7 describes most of the IOCTLs of sockios.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 11:49:06 +01:00
Michael Kerrisk 1078a69975 syscall.2: Minor tweaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 11:33:56 +01:00
Michael Kerrisk ddbe84e64e syscall.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 11:09:33 +01:00
Michael Kerrisk 9f9a9b76c8 syscall.2: Reformat tables to be narrower
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 11:07:25 +01:00
Mike Frysinger 8585e83715 syscall.2: Add more architectures and improve error documentation
Move the error register documentation into the main table rather
than listing them in sentences after the fact.

Add sparc error return details.

Add details for alpha/arc/m68k/microblaze/nios2/powerpc/superh/
tile/xtensa.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-30 10:44:43 +01:00
Michael Kerrisk e24fbf1098 Removed trailing white space at end of lines 2015-12-29 13:51:32 +01:00
Michael Kerrisk 6a95087eb2 clock_getres.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-29 13:50:26 +01:00
Michael Kerrisk 29b41e747f accept.2, acct.2, bind.2, clock_getres.2, connect.2, dup.2, epoll_create.2, eventfd.2, execve.2, fanotify_init.2, fcntl.2, fork.2, futex.2, get_robust_list.2, getcpu.2, getpeername.2, getrlimit.2, getsockname.2, getsockopt.2, gettimeofday.2, inotify_init.2, listen.2, membarrier.2, memfd_create.2, mlock.2, mmap.2, personality.2, pipe.2, poll.2, recv.2, send.2, sendfile.2, shmget.2, shutdown.2, sigreturn.2, socket.2, socketcall.2, socketpair.2, spu_create.2, swapon.2, time.2, timerfd_create.2, uselib.2, dlerror.3, dlopen.3, drand48.3, errno.3, fnmatch.3, getgrent.3, getgrnam.3, getlogin.3, getpwent.3, getpwnam.3, iconv.3, mq_open.3, opendir.3, random_r.3, sem_open.3, shm_open.3, tmpfile.3, tzset.3, random.4, fanotify.7, futex.7, vdso.7, ld.so.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-29 13:48:42 +01:00
Michael Kerrisk e258766bf4 accept.2, acct.2, epoll_create.2, execve.2, futex.2, inotify_init.2, mmap.2, open.2, pipe.2, shmget.2, socket.2, socketpair.2, spu_create.2, swapon.2, uselib.2, getgrent.3, getgrnam.3, getlogin.3, getpwent.3, getpwnam.3, mq_open.3, opendir.3, sem_open.3, shm_open.3, tmpfile.3, fanotify.7: ERRORS: standardize text for ENFILE error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-27 17:10:23 +01:00
Michael Kerrisk 26c32fabec accept.2, dup.2, eventfd.2, execve.2, fcntl.2, memfd_create.2, open.2, perf_event_open.2, pipe.2, signalfd.2, socket.2, socketpair.2, spu_create.2, timerfd_create.2, getgrent.3, getgrnam.3, getlogin.3, getpwent.3, getpwnam.3, mq_open.3, opendir.3, sem_open.3, shm_open.3, tmpfile.3: ERRORS: standardize text for EMFILE error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-27 16:37:03 +01:00
Michael Kerrisk 78d8b29eb5 inotify_init.2: ERRORS: add an EMFILE error case
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-27 16:37:03 +01:00
Michael Kerrisk 71d597e942 fanotify_init.2: ERRORS: add an EMFILE error case
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-27 16:37:03 +01:00
Michael Kerrisk 6bde54afad epoll_create.2: ERRORS: add another EMFILE error case
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-27 16:36:54 +01:00
Michael Kerrisk deedfd97fe accept.2, bind.2, connect.2, getpeername.2, getsockname.2, getsockopt.2, listen.2, recv.2, send.2, shutdown.2: ERRORS: standardize error text for ENOTSOCK error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-27 16:36:43 +01:00
Michael Kerrisk 8adaf0a794 futex.2: Minor wording tweaks after comments from Darren Hart
Reported-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-26 09:02:35 +01:00
Dmitry V. Levin ee25832b41 personality.2: Note kernel and glibc versions that introduced this system call
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-26 08:47:23 +01:00
Michael Kerrisk 0bf502fc7f poll.2: Shorten name of timeout argument for ppoll()
The name is overly long, and does not hint at the fact
that this argument is a pointer. Fix this by renaming:
s/timeout_ts/tmo_p/

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-23 23:25:41 +01:00
richardvoigt@gmail.com 32c8dbc049 poll.2: timeout_ts is a pointer, so use -> not . for member access
From the context, it is apparent that in the code explaining
ppoll in terms of poll, timeout_ts must be a pointer.

Usage #1:   ready = ppoll(&fds, nfds, timeout_ts, &sigmask);

Usage #2:    (timeout_ts == NULL)

Thus member access in (timeout_ts.tv_sec * 1000 +
timeout_ts.tv_nsec / 1000000) is an error.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-23 23:19:09 +01:00
Michael Kerrisk 2c7c50cd6a fork.2: Child of MT-process is restricted to async-signal-safe functions
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-22 15:02:42 +01:00
Mathieu Desnoyers 9f4d4bebe0 membarrier.2: tfix
"Ready-Copy-Update" should read "Read-Copy-Update".

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-20 21:48:57 +01:00
Michael Kerrisk b08d144c26 socketcall.2: Since Linux 4.3, x86-32 provides direct system calls for the sockets API
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-20 09:49:52 +01:00
Michael Kerrisk 2af84f99ad futex.2: wfix
Reported-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-19 06:22:47 +01:00
Michael Kerrisk bc54ed38c5 futex.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-19 06:22:11 +01:00
Michael Kerrisk 5e1456d4c9 futex.2: Replace "bitset" by "bit mask"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-19 06:22:02 +01:00
Michael Kerrisk 03323a99a4 epoll_ctl.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-19 06:03:41 +01:00
Michael Kerrisk 0594459d21 getrandom.2: tfix
Reported-by: Colin Rice <colin@daedrum.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-17 08:21:13 +01:00
Michael Kerrisk ce3f60394d getrlimit.2: The init of measurement for RLIMIT_RSS is bytes, not pages
Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-17 08:17:09 +01:00
Michael Kerrisk ab708dcbb2 time.2: Rename 't' argument to 'tloc'
'tloc' is visually easier to spot, and also is used
in POSIX and in man pages on other systems.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-17 06:49:29 +01:00
Michael Kerrisk 4af94291ae time.2: Describe EOVERFLOW details
Heavily based on text proposed by Paul Eggert.

Cowritten-by: Paul Eggert <eggert@cs.ucla.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-17 06:49:29 +01:00
Michael Kerrisk da894b18a8 futex.2: Fixes after comments from Darren Hart
Reported-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-17 06:43:53 +01:00
Michael Kerrisk 0fb87d16ac futex.2: Clarify "total ordering" a little
Comments from Davidlohr:

    So there are two things here regarding ordering. One is the
    most obvious which is ordered due to the taking/dropping the
    hb spinlock. Secondly, its the cases which Peter brought up
    a while ago that involves atomic futex ops futex_atomic_*(),
    which do not have clearly defined semantics, and you get
    inconsistencies with certain archs (tile being the worst
    iirc).

    But anyway, the important thing users need to know about is
    that the atomic futex operation must be totally ordered wrt
    any other user tasks that are trying to access that address.
    This is not necessarily the case for kernel ops. Peter
    illustrates this nicely with lock stealing example; (see
    https://lkml.org/lkml/2015/8/26/596).

    Internally, I believe we decided that making it fully ordered
    (as opposed to making use of implicit barriers for
    ACQUIRE/RELEASE), so you'd end up having an MB ll/sc MB kind of
    setup.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Reported-by: Davidlohr Bueso <dave@stgolabs.net>
2015-12-17 06:43:40 +01:00
Laurent Georget 4975d6af79 sendfile.2: Document more ERRORS
sendfile(2) can return more error codes than are
documented in sendfile(2). This patch adds some details:

    - EINVAL can be returned if count is negative; from function
      rw_verify_area in fs/read_write.c, called from do_sendfile,
      called from sys_sendfile.
    - EOVERFLOW can be returned if count is too large; from
      rw_verify_area, called from do_sendfile, called from
      sys_sendfile, or directly from do_sendfile in one case
      (pos + count > max size of either in_fd or out_fd).
    - ESPIPE can be returned if offset is not a NULL pointer but
      the input file does not support FMODE_PREAD;
      from do_sendfile, called from sys_sendfile.

Signed-off-by: Laurent Georget <laurent.georget@supelec.fr>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 16:43:45 +01:00
Zack Weinberg 300c07ddd8 time.2: Explain why the glibc time() wrapper never sets 'errno'
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-16 16:43:45 +01:00
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
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 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
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 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
Michael Kerrisk c0dc758efd futex.2: Rewrap some source lines (no content changes)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk 9d32a39b82 futex.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk d45f244c6d futex.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk 7e8dcabcb1 futex.2: Reword paragraph describing futex word
Reported-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk 02f7b623c9 futex.2: NOTES: futexes are also used to implement read-write locks and barriers
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk e0074751c9 futex.2: SEE ALSO: add pthread_mutexattr_getprotocol(3)
Reported-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk 36a90a75ce futex.2: wfix
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk d6bb5a38db futex.2: Tidy up some FIXMEs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk cf44281c66 futex.2: Point out that futexes are used to implement higher-level abstractions
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Torvald Riegel <triegel@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk 78bbcd9faf futex.2: Remove an obsolete FIXME
Reviewed-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk cabee29d5e futex.2: tfix
Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk e61abc2018 futex.2: tfix
Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk a5c5a06aba futex.2: Clarify return value details
Reporte-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk 943ccc5228 futex.2: Remove detail about kernel internals
As commented on by Davidlohr Bueso:

    This to me reads a bit too much into the kernel (fastpath,
    refcnt, vmas). Why not just mention that it avoids overhead
    in the kernel or something? I don't recall any manpage
    mentioning such details, but I could be wrong.

Reported-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Heinrich Schuchardt 10022b8e63 futex.2: Casting utime to uint32_t
The kernel uses the following cast:

  if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE ||
      cmd == FUTEX_CMP_REQUEUE_PI || cmd == FUTEX_WAKE_OP)
    val2 = (u32) (unsigned long) utime;

This ensures that always the least significant four bytes of the
pointer are used, both on ILP32 and LP64 systems.

On a big endian system a simple cast from 64 bit pointer to 32 bit
integer would return the most significant four bytes.

We have to make the reader of the man-page aware of the usage
of the least significant bytes.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Heinrich Schuchardt c6dc40a2c9 futex.2: Use known types
Type u32 is not exposed to the user.  Instead, refer to uint32_t,
which is defined in ISO/IEC 9899:1999.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Heinrich Schuchardt d725ab772e futex.2: tfix
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk 78e856927e futex.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Michael Kerrisk 0c3ec26b07 futex.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Heinrich Schuchardt 8e754e12c5 futex.2: explanation of blocking
Use shorter sentences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:48 +01:00
Heinrich Schuchardt b80daba225 futex.2: explanation of blocking behavior
Shorten overlong sentence.
Highlight futex().
Tfix.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Heinrich Schuchardt 344df36631 futex.2: clarify address mapping
Using the word "physical" address should make the text easier to
make.

Avoid negations like "may not be equal".

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Heinrich Schuchardt 594536fb2c futex.2: tfix
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 4c8cb0ffe6 futex.2: Rewrap some long source lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 83e80dda44 futex.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Heinrich Schuchardt 63ad44cb92 futex.2: simplify example
Do not duplicate coding.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Heinrich Schuchardt 92a4669004 futex.2: futex.2: Fix error check in EXAMPLE: fork() fails with -1
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 357646628c futex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 077981d467 futex.2: Wrap sentences at line boundaries
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 74f58a643b futex.2: Explicitly mark FIXMEs added by Torvald Riegel
Mainly so I can keep track of who said what should be fixed/checked

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Torvald Riegel 4b35dc5dab futex.2: Terminology fixes
Here is the result of a first pass over futex.2.  I tried to
do nothing that is too controversial.  I tried to apply the
terminology that at least Darren and I had in mind
consistently; but please check again.

The major changes are in how futexes are described in the
introductory parts of the page.  I hope it's easier to understand
now.  I've also tried to add some more precision to the the
description of the synchronization semantics (e.g., it makes a
difference whether we claim something is atomic (without further
qualification), or just atomic wrt.  other futex operations).
In some cases, that adds some verbosity to the text -- but I
believe that this is worth the clarity and consistency in using
terms, for example.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 77da5febea futex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 305cc4153b futex.2: Add EXAMPLE program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk a4a529e85b get_robust_list.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk c0a181aa97 get_robust_list.2: Reword EINVAL error text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 02182e7c8c futex.2: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 1af427a43d futex.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 47f5c4baf5 futex.2: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk f529fd2013 futex Since Linux 2.6.22, EINTR can no longer occur on spurious wakeup
As reported by Rich Felker:

    I see no code in the kernel whereby a "spurious wakeup",
    or anything other than interruption by a signal handler
    that's not SA_RESTART, can cause futex to fail with EINTR.
    In general, overloading of EINTR and/or spurious EINTRs
    from a syscall make it impossible to use that syscall for
    implementing any function where EINTR is a mandatory
    failure on interruption-by-signal, since there is no way
    for userspace to distinguish whether the EINTR occurred
    as a result of an interrupting signal or some other
    reason. The kernel folks have gone to great lengths to fix
    spurious EINTRs (see signal(7) for history), especially by
    non-interrupting signal handlers, including in futex, and
    allowing EINTR here would be contrary to that goal.

     It's my belief that the "or a spurious wakeup" text should
     simply be removed.

     The reason I'm raising this topic is its relevance to a
     thread on libc-alpha:

     [RFC] mutex destruction (#13690): problem description and workarounds

The bug and mailing list discussions to which Rich refers are:
     https://sourceware.org/bugzilla/show_bug.cgi?id=13690
     https://sourceware.org/ml/libc-alpha/2014-12/threads.html#0001

Torvald Riegel also reported the same issue, and Thomas Gleixner
noted that the "EINTR on spurious wakeup" behavior went away in
Linux 2.6.22. See the LKML thread, "futex() man page update help
request", Jan 2015:
http://thread.gmane.org/gmane.linux.kernel/1703405/focus=7734

Reported-by: Rich Felker <dalias@libc.org>
Reported-by: Torvald Riegel <triegel@redhat.com>
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtknpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 9732dd8b3f futex.2: Various fixes after review from Davidlohr Bueso
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 2abcba676a futex.2: Remove FUTEX_REQUEUE EINVAL error case
Thomas Gleixner confirmed my reading that this case does
not apply.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 9e2b90ee42 futex.2: Add an attmpt at a defintion of PI-aware futexes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk 7bd3ffbc52 futex.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:47 +01:00
Michael Kerrisk d9d5be6bea futex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk 809ca3ae64 futex.2: Note that the kernel only "knows" about a futex in the contended case
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk a663ca5a12 futex.2: Add some subsection headings
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk e219551457 futex.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk ed44c7c071 futex.2: Rewrite text on intended users of futexes
Eliminate some redundant text.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk abb571e8b7 futex.2: Add text on pairing of FUTEX_WAIT_REQUEUE_PI + FUTEX_CMP_REQUEUE_PI
Reported-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk f1d2171d38 futex.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk bdc5957afa futex.2: Process/thread rewordings
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk a59564304a futex.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk 6700de2462 futex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk 7d20efd7b0 futex.2: Add overview of priority inheritance
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk b565548bfa futex.2: Add brief description of the priority inversion problem
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk dd003bef7a futex.2: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk 8fe019c733 futex.2: SEE ALSO: add Documentation/robust-futex-ABI.txt
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk 4cf9289452 futex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk baf0f1f470 futex.2: Note that syscall() must be employed
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk 4c2222812b futex.2: SEEL ALSO: add author details + other minor tweaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00
Michael Kerrisk 939ca89f38 futex.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-15 14:39:46 +01:00