Commit Graph

9334 Commits

Author SHA1 Message Date
Michael Kerrisk 3bed246e7e seccomp.2: Some reworking of Tycho's SECCOMP_RET_USER_NOTIF patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:40:16 +12:00
Tycho Andersen c734bbd265 seccomp.2: Document SECCOMP_RET_USER_NOTIF
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:40:16 +12:00
Michael Kerrisk 6fc8b8a0a1 seccomp.2: Minor edits to Tycho Andersen's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:40:16 +12:00
Tycho Andersen 9bc48145a6 seccomp.2: Document SECCOMP_GET_NOTIF_SIZES
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
CC: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:40:16 +12:00
Michael Kerrisk 408483bd31 socketcall.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:37:46 +12:00
Alejandro Colomar b6687e3971 socketcall.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:37:46 +12:00
Alejandro Colomar 1b4d275a0e sigprocmask.2: Use syscall(SYS_...); for raw system calls
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:37:46 +12:00
Alejandro Colomar aa03a4e732 shmop.2: Remove unused include
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:37:46 +12:00
Alejandro Colomar 1cd36d9dea sgetmask.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:37:46 +12:00
Alejandro Colomar 18e21e1e4c set_tid_address.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:37:46 +12:00
Alejandro Colomar ba4d34a16d set_thread_area.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:37:46 +12:00
Alejandro Colomar 9202a1eb8e rt_sigqueueinfo.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:37:46 +12:00
Alejandro Colomar 5e9623f3b9 open.2: Remove unused <sys/stat.h>
I can't see a reason to include it.  <fcntl.h> provides O_*
constants for 'flags', S_* constants for 'mode', and mode_t.

Probably a long time ago, some of those weren't defined in
<fcntl.h>, and both headers needed to be included, or maybe it's
a historical error.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:37:46 +12:00
Michael Kerrisk 14987c153f setresuid.2: tfix (Oxford comma)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-21 20:19:28 +12:00
Michael Kerrisk e4a403876d select.2: Strengthen the warning regarding the low value of FD_SETSIZE
All modern code should avoid select(2) in favor of poll(2)
or epoll(7).

For a long history of this problem, see:

https://marc.info/?l=bugtraq&m=110660879328901
    List:       bugtraq
    Subject:    SECURITY.NNOV: Multiple applications fd_set structure bitmap array index overflow
    From:       3APA3A <3APA3A () security ! nnov ! ru>
    Date:       2005-01-24 20:30:08

https://sourceware.org/legacy-ml/libc-alpha/2003-05/msg00171.html
    User-settable FD_SETSIZE and select()
    From: mtk-lists at gmx dot net
    To: libc-alpha at sources dot redhat dot com
    Date: Mon, 19 May 2003 14:49:03 +0200 (MEST)
    Subject: User-settable FD_SETSIZE and select()

https://sourceware.org/bugzilla/show_bug.cgi?id=10352

http://0pointer.net/blog/file-descriptor-limits.html
https://twitter.com/pid_eins/status/1394962183033868292

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-20 11:00:11 +12:00
Michael Kerrisk 2a1ba6ae7f select.2: Relocate sentence about the fd_set value-result arguments to BUGS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-20 09:49:09 +12:00
Alejandro Colomar 65dfda3dd1 sched_setattr.2: Use syscall(SYS_...); for system calls without a wrapper
Document also why each header is required

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-17 20:04:30 +12:00
Alejandro Colomar d4d006687d s390_sthyi.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-17 20:04:30 +12:00
Alejandro Colomar c6450cf82b s390_sthyi.2: Replace numeric constant by its name (macro)
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Eugene Syromyatnikov <evgsyr@gmail.com>
Cc: QingFeng Hao <haoqf@linux.vnet.ibm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-17 20:04:30 +12:00
Alejandro Colomar cca4e32eb3 s390_runtime_instr.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-17 20:04:30 +12:00
Alejandro Colomar f908665187 s390_pci_mmio_write.2: Use syscall(SYS_...); for system calls without a wrapper; fix includes too
This function doesn't use any flags or special types, so there's
no reason to include <asm/unistd.h>; remove it.  Add the includes
needed for syscall(2) only.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-17 20:04:30 +12:00
Alejandro Colomar 56cfe81cfb s390_guarded_storage.2: Use syscall(SYS_...); for system calls without a wrapper
Also document why each header is needed.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-17 20:04:30 +12:00
Alejandro Colomar cc6f5bf20f rename.2: ffix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-17 16:44:37 +12:00
Michael Kerrisk 090fdddb43 memfd_create.2, mmap.2, shmget.2: Document the EPERM for huge page allocations
This error can occur if the caller is does not have CAP_IPC_LOCK
and is not a member of the sysctl_hugetlb_shm_group.

Reported-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-17 15:42:04 +12:00
Michael Kerrisk 66c743b191 getdents.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar fac7dabcd1 reboot.2: Use syscall(SYS_...); for system calls without a wrapper
Explain also why headers are needed.
And some ffix.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 71b08c22b5 readlink.2: ffix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 8f33ee075a readdir.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 05214ec7ba quotactl.2: Better detail why <xfs/xqm.h> is included
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 4e8ac36900 process_madvise.2: Use syscall(SYS_...); for system calls without a wrapper. Fix includes too.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar e393b243c0 poll.2: Remove <signal.h>
It is only used for providing 'sigset_t'.  We're only documenting
(with some exceptions) the includes needed for constants and the
prototype itself.  And 'sigset_t' is better documented in
system_data_types(7).  Remove that include.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 3e67d1a76b pivot_root.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 5a24cb274f pipe.2: wfix
For consistency with other pages.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 94df87ef9b pidfd_send_signal.2: Use syscall(SYS_...); for system calls without a wrapper. Fix includes too
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 46227ba213 pidfd_open.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 13cf4fc78a pidfd_getfd.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar e691579150 perf_event_open.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 10f4414ccb openat2.2: Use syscall(SYS_...); for system calls without a wrapper; fix includes too
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar bc2813df5e alloc_hugepages.2, arch_prctl.2, capget.2, clone.2, delete_module.2, exit_group.2, get_robust_list.2, getunwind.2, init_module.2: Add note about the use of syscall(2)
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar a39bcd0b85 mq_getsetattr.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 57d2facb78 modify_ldt.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 0eefb56c95 mmap2.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:45 +12:00
Alejandro Colomar 01ee7ce9b7 mknod.2: Remove unused includes
All of the constants used by mknod() are defined in <sys/stat.h>.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:28:38 +12:00
Alejandro Colomar c88fc2baad mincore.2: Remove unused include
AFAICS, there's no use for <unistd.h> here.  The prototype is
declared in <sys/mman.h>, and there are no constants needed.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 39df5bd6bc membarrier.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 3977e9ff1f lookup_dcookie.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar aecad91d0b llseek.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar f1d0eaf52b link.2: ffix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 5b013bd50f keyctl.2: Use syscall(SYS_...); for system calls without a glibc wrapper
Remove the libkeyutils prototype from the synopsis, which isn't
documented in the rest of the page, and as NOTES says, it's
probably better to use the various library functions.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar e59830eda9 kexec_load.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar b5c3fcdb65 kcmp.2: tfix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 2f4306b033 kcmp.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar e3e30ce1bd ipc.2: Add needed include
The constants needed for using this function are defined in
<linux/ipc.h>.  Add the include, even when those constants are not
mentioned in this manual page.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar acb2e04c24 ipc.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 0d961e8818 ioprio_set.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 2f8cb589fb ioperm.2: Remove obvious comment
Of course that is for the glibc wrapper.  As all of the other
pages that don't explicitly say otherwise.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 8b4c942c50 io_getevents.2: Use syscall(SYS_...); for system calls without a wrapper
In this case there's a wrapper provided by libaio,
but this page documents the raw syscall.

Also remove <linux/time.h> from the includes: 'struct timespec'
is already documented in system_data_types(7), where the
information is more up to date.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 950d1738ef io_destroy.2: Use syscall(SYS_...); for system calls without a wrapper
In this case there's a wrapper provided by libaio,
but this page documents the raw syscall.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar cac89bc794 ioctl_userfaultfd.2: SYNOPSIS: Add <linux/userfaultfd.h>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 70f9a4edb3 ioctl_tty.2: Fix includes
<sys/ioctl.h> is needed for the prototype of ioctl().  That header
also provides most of the constants used by the function.  Only a
few of those constants are not provided by that header, and need
<termios.h>; clarify which constants do need that include.

......

$ <man2/ioctl_tty.2 \
  sed -n '/^.SH DESCRIPTION/,/^.SH/p' \
  |grep -e '^\.B' -e TIOCM \
  |sed 's/^\.B[^ ]* //' \
  |awk '{print $1}' \
  |grep '^[[:upper:]]' \
  |grep -v -e '^CAP' -e '^E' -e '^SIG' -e '^O_' -e '^[TR]XD$' -e '^POLL' \
  |sort \
  |uniq \
  |while read f; do \
	find /usr/include/ -type f \
	|xargs grep -l "define\s$f" \
	|grep -q ioctl.*.h \
	||echo $f \
	|while read ff; do \
		echo "============ $ff"; \
		find /usr/include/ -type f \
		|xargs grep -n "define\s$ff"; \
	done; \
  done;
============ CLOCAL
/usr/include/asm-generic/termbits.h:142:#define CLOCAL	0004000
/usr/include/gphoto2/gphoto2-port-portability.h:127:#   define CLOCAL  0x00000800
/usr/include/x86_64-linux-gnu/bits/termios-c_cflag.h:34:#define CLOCAL	0004000
============ TCIFLUSH
/usr/include/asm-generic/termbits.h:191:#define	TCIFLUSH	0
/usr/include/x86_64-linux-gnu/bits/termios.h:70:#define	TCIFLUSH	0
============ TCIOFF
/usr/include/asm-generic/termbits.h:187:#define	TCIOFF		2
/usr/include/x86_64-linux-gnu/bits/termios.h:66:#define	TCIOFF		2
============ TCIOFLUSH
/usr/include/asm-generic/termbits.h:193:#define	TCIOFLUSH	2
/usr/include/x86_64-linux-gnu/bits/termios.h:72:#define	TCIOFLUSH	2
============ TCION
/usr/include/asm-generic/termbits.h:188:#define	TCION		3
/usr/include/x86_64-linux-gnu/bits/termios.h:67:#define	TCION		3
============ TCOFLUSH
/usr/include/asm-generic/termbits.h:192:#define	TCOFLUSH	1
/usr/include/x86_64-linux-gnu/bits/termios.h:71:#define	TCOFLUSH	1
============ TCOOFF
/usr/include/asm-generic/termbits.h:185:#define	TCOOFF		0
/usr/include/x86_64-linux-gnu/bits/termios.h:64:#define	TCOOFF		0
============ TCOON
/usr/include/asm-generic/termbits.h:186:#define	TCOON		1
/usr/include/x86_64-linux-gnu/bits/termios.h:65:#define	TCOON		1
============ TIOCREMOTE
============ TIOCSTART
============ TIOCSTOP
============ TIOCTTYGSTRUCT
============ TIOCUCNTL

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 4b63cf3ca7 getdents.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 0aa385fe25 futex.2: Use syscall(SYS_...); for system calls without a wrapper
At the same time, document only headers that are required
for calling the function, or those that are specific to the
function:

<unistd.h> is required for the syscall() prototype.
<sys/syscall.h> is required for the syscall name SYS_xxx.
<linux/futex.h> is specific to this syscall.

However, uint32_t is generic enough that it shouldn't be
documented here.  The system_data_types(7) page already documents
it, and is more precise about it.  The same goes for timespec.

As a general rule a man[23] page should document the header that
includes the prototype, and all of the headers that define macros
that should be used with the call.  However, the information about
types should be restricted to system_data_types(7) (and that page
should probably be improved by adding types), except for types
that are very specific to the call.  Otherwise, we're duplicating
info and it's then harder to maintain, and probably outdated in
the future.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 1cf69258ad execveat.2: Remove unused include
This complements commit e3eba861bd.

Since we don't need syscall(2) anymore, we don't need SYS_* definitions.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 05:06:23 +12:00
Alejandro Colomar 1c55195743 open.2: Fix bug in linkat(2) call example
AT_EMPTY_PATH works with empty strings (""), but not with NULL
(or at least it's not obvious).

The relevant kernel code is the following:

linux$ sed -n 189,198p fs/namei.c
	result->refcnt = 1;
	/* The empty path is special. */
	if (unlikely(!len)) {
		if (empty)
			*empty = 1;
		if (!(flags & LOOKUP_EMPTY)) {
			putname(result);
			return ERR_PTR(-ENOENT);
		}
	}

Reported-by: Walter Harms <wharms@bfs.de>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 04:34:03 +12:00
Alejandro Colomar 099b33fbff epoll_wait.2: Move subsection to NOTES from BUGS
'C library/kernel differences' was added to BUGS incorrectly.
Fix it

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 13:05:42 +12:00
Alejandro Colomar 4cc91169d0 sched_get_priority_max.2, open_memstream.3: tfix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 11:19:29 +12:00
Alejandro Colomar fe10d82f6e clone.2: tfix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 11:17:11 +12:00
Akihiro Motoki 19063c3c07 signalfd.2: tfix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Akihiro Motoki a128697221 semctl.2: ffix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Akihiro Motoki 4f060b5467 move_pages.2: ffix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Štěpán Němec 85102346e3 execve.2: tfix
Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Vishwajith K 5974cc557f shmop.2: tfix
Signed-off-by: Vishwajith K <vishuvikas1996@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Alejandro Colomar f729c4f36e sigwaitinfo.2: tfix
Fix wording issue introduced in commit
bf1298c9e5.

Reported-by: Chris Keilbart <keilbartchris@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Jakub Wilk ba48f20bc4 exit_group.2, getunwind.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Dmitry V. Levin 8bc6f5fdea ptrace.2: mention PTRACE_GET_SYSCALL_INFO in RETURN VALUE section
Mirror the wording about PTRACE_GET_SYSCALL_INFO return value semantics
from "DESCRIPTION" section to "RETURN VALUE" section.

Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Complements: fc91449cb "ptrace.2: Document PTRACE_GET_SYSCALL_INFO"
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Dmitry V. Levin 4d95a1eef3 move_pages.2: ffix
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Johannes Berg 1874ca39ba clone.2: tfix
Despite my mention of this spawning a hilarious discussion
on IRC, this alignment restriction should be 128-bit, not
126-bit.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Borislav Petkov 67238a538d sigaltstack.2: tfix
Add a missing "to" in an "in order to" formulation.

Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Aurelien Aptel 334ed9799d flock.2: add CIFS details
CIFS flock() locks behave differently than the standard. Give overview
of those differences.

Here is the rendered text:

CIFS details
  In Linux kernels up to 5.4, flock() is not propagated over SMB.  A file
  with such locks will not appear locked for remote clients.

  Since Linux 5.5, flock() locks are emulated with SMB  byte-range  locks
  on  the  entire  file.   Similarly to NFS, this means that fcntl(2) and
  flock() locks interact with one another.  Another important side-effect
  is  that  the  locks  are not advisory anymore: any IO on a locked file
  will always fail with EACCES when done from a separate file descriptor.
  This  difference  originates from the design of locks in the SMB proto-
  col, which provides mandatory locking semantics.

  Remote and mandatory locking semantics  may  vary  with  SMB  protocol,
  mount options and server type.  See mount.cifs(8) for additional infor-
  mation.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Discussion: linux-man <https://lore.kernel.org/linux-man/20210302154831.17000-1-aaptel@suse.com/>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 09:09:11 +12:00
Alejandro Colomar dffa597887 Various pages: Remove unused <sys/ipc.h> (and <sys/types.h>)
In b0b19983d9 we removed
<sys/types.h>.  For the same reasons there, remove now <sys/ipc.h>
from many pages.

If someone wonders why <sys/ipc.h> was needed, the reason was to
get all the definitions of IPC_* constants.  However, that header
is now included by <sys/msg.h>, so it's not needed anymore to
explicitly include it.  Quoting POSIX: "In addition, the
<sys/msg.h> header shall include the <sys/ipc.h> header."

There were some remaining cases where I forgot to remove
<sys/types.h>; remove them now too.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 07:47:06 +12:00
Alejandro Colomar a484b43bde open_by_handle_at.2: Remove unused <sys/stat.h>
AFAICS, all types and constants used by these functions are
defined in <fcntl.h>.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 06:10:12 +12:00
Michael Kerrisk eb2b1b990d syscalls.2: perfmonctl(2) was removed in Linux 5.10
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 06:08:38 +12:00
Michael Kerrisk 9c6ca43e91 perfmonctl.2: This system call was removed in Linux 5.10
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 06:08:38 +12:00
Michael Kerrisk e3eba861bd execveat.2: Library support has been added in glibc 2.34
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 04:16:42 +12:00
Michael Kerrisk ba93f72c44 syscalls.2: SEE ALSO: add ausyscall(1)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-29 21:14:59 +02:00
Michael Kerrisk 2673a70a57 get_mempolicy.2, mq_getsetattr.2, poll.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-06 13:44:48 +02:00
Michael Kerrisk 92a4b09356 pipe.2: Rearrange SYNOPSIS so that minority version pipe() is at end
A few architectures have a different call signature for pipe().
Since those architectures are the minority, place the prototype
at the end of the SYNOPSIS, rather than the start.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-06 13:44:48 +02:00
Michael Kerrisk 3ab99460db mount.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-06 13:44:48 +02:00
Michael Kerrisk 9ae36f1824 userfaultfd.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-06 13:44:48 +02:00
Michael Kerrisk 1cf1ada55a ioctl_userfaultfd.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-06 13:44:48 +02:00
Michael Kerrisk 7a3d084504 ioctl_userfaultfd.2, userfaultfd.2: Minor tweaks to Peter Xu's patches
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-06 10:04:46 +02:00
Peter Xu f559fa36a6 ioctl_userfaultfd.2: Add write-protect mode docs
Userfaultfd write-protect mode is supported starting from Linux 5.7.

Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
[alx: ffix + srcfix]
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 22:02:44 +02:00
Peter Xu fbda69bbdd ioctl_userfaultfd.2: Add UFFD_FEATURE_THREAD_ID docs
UFFD_FEATURE_THREAD_ID is supported in Linux 4.14.

Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 22:02:05 +02:00
Peter Xu 4b338b38e6 userfaultfd.2: Add write-protect mode
Write-protect mode is supported starting from Linux 5.7.

Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 22:00:21 +02:00
Peter Xu e70f957d81 userfaultfd.2: Add UFFD_FEATURE_THREAD_ID docs
UFFD_FEATURE_THREAD_ID is supported since Linux 4.14.

Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
[alx: srcfix]
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 21:48:53 +02:00
Alejandro Colomar 0bdc3187ec io_cancel.2: Use syscall(SYS_...); for system calls without a wrapper
In this case there's a wrapper provided by libaio,
but this page documents the raw kernel syscall.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:44:48 +02:00
Alejandro Colomar d9f8238d37 init_module.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:44:48 +02:00
Alejandro Colomar 4695076306 delete_module.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:44:48 +02:00
Michael Kerrisk 843c01931c get_robust_list.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:44:48 +02:00
Alejandro Colomar eb4a40e023 get_robust_list.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:44:48 +02:00
Alejandro Colomar a2fe65bc36 getunwind.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:44:48 +02:00
Alejandro Colomar 73f2d2ba11 exit_group.2: Use syscall(SYS_...); for system calls without a wrapper
<linux/unistd.h> is not needed.  We need <unistd.h> for syscall(),
and <sys/syscall.h> for SYS_exit_group.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:44:48 +02:00
Alejandro Colomar 86970bf4d3 execveat.2: Use syscall(SYS_...); for system calls without a wrapper
Add <linux/fcntl.h>, which contains AT_* definitions used by
execveat().

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:44:48 +02:00
Alejandro Colomar a380538369 clone.2: Use syscall(SYS_...); for system calls without a wrapper
The CLONE_* constants seem to be available from either
<linux/sched.h> or <sched.h>, and since clone3() already
includes <linux/sched.h> for 'struct clone_args', <sched.h>
is not really needed, AFAICS; however, to avoid confusion,
I also included <sched.h> for clone3() for consistency:

clone() is getting CLONE_* from <sched.h>, and it would confuse
the reader if clone3() got the same CLONE_* constants from a
different header.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:44:42 +02:00
Michael Kerrisk 74ddb3019f capget.2: Minor tweaks to Alex Colomar's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:29:05 +02:00
Alejandro Colomar 00e4779ad7 capget.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:26:53 +02:00
Alejandro Colomar 149eb741d7 arch_prctl.2: SYNOPSIS: Remove unused includes
AFAICS, there's no reason to include that.
All of the macros that this function uses
are already defined in the other headers.

Cc: glibc <libc-alpha@sourceware.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:25:23 +02:00
Alejandro Colomar a9a96d8a5b arch_prctl.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:25:14 +02:00
Alejandro Colomar 58d15b72da alloc_hugepages.2: Use syscall(SYS_...); for system calls without a wrapper
The page didn't specify includes, and the syscalls are extinct, so
instead of adding incomplete information about includes, just
leave it without any includes.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:23:06 +02:00
Alejandro Colomar 4175b08beb access.2: Use syscall(SYS_...); for system calls without a wrapper
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:17:25 +02:00
Michael Kerrisk fa1755e4be ioctl_fideduperange.2: Minor tweaks to Alex Colomar's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:15:31 +02:00
Alejandro Colomar 0fdaa53806 ioctl_fideduperange.2: Make clear why exactly is each header needed
Only the include that provides the prototype doesn't need a comment.

Also sort the includes alphabetically.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:13:57 +02:00
Alejandro Colomar 40798f5b45 ioctl_ficlonerange.2: Make clear why is each header exactly needed.
Only the one that provides the prototype doesn't need a comment.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:13:00 +02:00
Alejandro Colomar f72f6f260b ioctl_fslabel.2: ffix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:10:31 +02:00
Michael Kerrisk 5aed5c683e ioctl_getfsmap.2: Minor tweaks to Alex Colomar's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:08:58 +02:00
Alejandro Colomar 2ef3cedaf4 ioctl_getfsmap.2: Make clear why exactly is each header needed
<linux/fs.h> doesn't seem to be needed!
Only the include that provides the prototype doesn't need a comment.

Also sort the includes alphabetically.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:05:44 +02:00
Alejandro Colomar 9c9e0561d0 ioctl_fslabel.2: Make clear why exactly is each header needed
Only the include that provides the prototype doesn't need a comment.

Also sort the includes alphabetically.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:05:23 +02:00
Michael Kerrisk 0b1dc48225 ioctl_fat.2: Minor tweaks to Alex Colomar's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 13:05:23 +02:00
Alejandro Colomar a71d209b9b ioctl_fat.2: tfix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 12:58:29 +02:00
Alejandro Colomar 3a0989120d ioctl_fat.2: Make clear why is each header exactly needed.
Only the one that provides the prototype doesn't need a comment.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 12:57:23 +02:00
Alejandro Colomar 1852998a68 dup.2: SYNOPSIS: Use consistent comments through pages
[mtk: Alex's change switches the comment to the more generally used
form "Definition of..."]

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 12:53:41 +02:00
Alejandro Colomar d2ac3dcfbe fanotify_init.2: Add comment: why more than one include is needed
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 12:50:00 +02:00
Alejandro Colomar 0cb59ab63f getpriority.2: Remove unused include
<sys/time.h> is not needed to get the function declaration nor any
constant used by the function.  It was only needed (before
POSIX.1) to get 'struct timeval', but that information would be
more suited for system_data_types(7), and not for this page.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 12:49:18 +02:00
Alejandro Colomar 43be8898c2 delete_module.2: Add missing include
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 12:48:35 +02:00
Alejandro Colomar 1e145f150d getrlimit.2, getrusage.2: Remove unused include
<sys/time.h> is not required by any of the function declarations
or macro definitions used by these functions.  It may be (or maybe
not) needed by some type inside the rlimit structure, but that
info belongs in system_data_types(7), not here.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 12:47:01 +02:00
Alejandro Colomar 8c402eb013 add_key.2: Remove unused include
<sys/types.h> was only needed for size_t, AFAIK.  That is already
(and more precisely) documented in system_data_types(7).  Let's
remove it here, as it's not really needed for calling add_key().

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 12:45:48 +02:00
Alejandro Colomar af2ea7fdbb fcntl.2: Remove unused include
I couldn't find a reason for including <unistd.h>.  All the macros
used by fcntl() are defined in <fcntl.h>.  For comparison, FreeBSD
and OpenBSD don't specify <unistd.h> in their manual pages.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 12:43:49 +02:00
Alejandro Colomar f6ecadcba1 exit_group.2: Use 'noreturn' in prototypes
This function never returns to its caller.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 12:43:05 +02:00
Alejandro Colomar c0e1178b14 futimesat.2: ffix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-05 12:41:53 +02:00
Michael Kerrisk 8e2cab90e1 set_mempolicy.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-04 22:07:31 +02:00
Huang Ying 5858ad9ca8 set_mempolicy.2: Add mode flag MPOL_F_NUMA_BALANCING
In Linux kernel 5.12, a new mode flag, MPOL_F_NUMA_BALANCING, is
added to set_mempolicy() to optimize the page placement among the
NUMA nodes with the NUMA balancing mechanism even if the memory of
the applications is bound with MPOL_BIND.  This patch updates the
man page for the new mode flag.

Related kernel commits:
bda420b985054a3badafef23807c4b4fa38a3dff

[mtk: Minor fixes to commit message]

Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
Cc: "Michael Kerrisk" <mtk.manpages@gmail.com>
[ alx: srcfix ]
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-04 22:04:49 +02:00
Bruce Merry 285a7373e7 mmap.2: Clarify that MAP_POPULATE is best-effort
As discussed on linux-mm
(https://marc.info/?l=linux-mm&m=161528594100612&w=2), MAP_POPULATE can
fail silently if the hugetlb cgroup settings allow huge page reservation
but prevents huge pages being allocated.

Closes https://bugzilla.kernel.org/show_bug.cgi?id=212153.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-04 22:03:30 +02:00
Michael Kerrisk 1f72eb7511 write.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-04-02 12:28:00 +02:00
Michael Kerrisk 46b470231f listen.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-26 12:05:15 +01:00
Michael Kerrisk 737a840daa _exit.2: Add a little more detail on the raw _exit() system cal
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-25 09:32:30 +01:00
Michael Kerrisk b96ad91c7c dup.2: Further clarify the effect of dup2()
Add a sentence explaining what dup2() does in terms of file
descriptors and open file descriptions.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-23 11:33:40 +01:00
Michael Kerrisk 8b339e35fa dup.2: Clarify what silent closing means
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-23 11:27:39 +01:00
Michael Kerrisk 5c3611aa44 open.2: Make it clearer that an FD is an index into the process's FD table
Sometimes people are confused, thinking a file descriptor is just a
number.  To help avoid such confusions, add text highlighting that
a file descriptor is an index to an entry in the process's FD table.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-23 11:05:24 +01:00
Michael Kerrisk f5270fe6f8 dup.2: Rewrite the description of dup() somewhat
As can be seen by any number of StackOverflow questions, people
persistently misunderstand what dup() does, and the existing manual
page text, which talks of "copying" a file descriptor doesn't help.
Rewrite the text a little to try to prevent some of these
misunderstandings, in particular noting at the start that dup()
allocates a new file descriptor.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-23 10:38:28 +01:00
Michael Kerrisk 1d767b552e getent.1, ldd.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, add_key.2, adjtimex.2, alloc_hugepages.2, arch_prctl.2, bdflush.2, bind.2, bpf.2, brk.2, cacheflush.2, capget.2, chdir.2, chmod.2, chown.2, chroot.2, clock_getres.2, clock_nanosleep.2, clone.2, close.2, close_range.2, connect.2, copy_file_range.2, create_module.2, delete_module.2, dup.2, epoll_create.2, epoll_ctl.2, epoll_wait.2, eventfd.2, execve.2, execveat.2, fanotify_init.2, fanotify_mark.2, fcntl.2, flock.2, fork.2, fsync.2, futex.2, get_kernel_syms.2, get_mempolicy.2, get_robust_list.2, getcpu.2, getdents.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getitimer.2, getpagesize.2, getpeername.2, getpid.2, getpriority.2, getrandom.2, getresuid.2, getrlimit.2, getrusage.2, getsid.2, getsockname.2, getsockopt.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, getxattr.2, idle.2, init_module.2, inotify_add_watch.2, inotify_rm_watch.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioctl.2, ioctl_console.2, ioctl_fat.2, ioctl_ficlonerange.2, ioctl_fideduperange.2, ioctl_fslabel.2, ioctl_getfsmap.2, ioctl_ns.2, ioctl_tty.2, ioctl_userfaultfd.2, ioperm.2, iopl.2, ipc.2, kcmp.2, kexec_load.2, keyctl.2, kill.2, link.2, listen.2, listxattr.2, llseek.2, lookup_dcookie.2, lseek.2, madvise.2, mbind.2, membarrier.2, memfd_create.2, migrate_pages.2, mincore.2, mkdir.2, mknod.2, mlock.2, mmap.2, mmap2.2, modify_ldt.2, mount.2, move_pages.2, mprotect.2, mq_getsetattr.2, mremap.2, msgctl.2, msgget.2, msgop.2, msync.2, nanosleep.2, nfsservctl.2, nice.2, open.2, open_by_handle_at.2, openat2.2, pause.2, pciconfig_read.2, perf_event_open.2, perfmonctl.2, personality.2, pidfd_getfd.2, pidfd_open.2, pidfd_send_signal.2, pipe.2, pivot_root.2, pkey_alloc.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, read.2, readahead.2, readdir.2, readlink.2, readv.2, reboot.2, recv.2, remap_file_pages.2, removexattr.2, rename.2, request_key.2, restart_syscall.2, rmdir.2, rt_sigqueueinfo.2, s390_guarded_storage.2, s390_pci_mmio_write.2, s390_runtime_instr.2, s390_sthyi.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, seccomp.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, send.2, sendfile.2, set_thread_area.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setpgid.2, setresuid.2, setreuid.2, setsid.2, setuid.2, setup.2, setxattr.2, sgetmask.2, shmctl.2, shmget.2, shmop.2, shutdown.2, sigaction.2, sigaltstack.2, signal.2, signalfd.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, socket.2, socketcall.2, socketpair.2, splice.2, spu_create.2, spu_run.2, stat.2, statfs.2, statx.2, stime.2, subpage_prot.2, swapon.2, symlink.2, sync.2, sync_file_range.2, syscall.2, syscalls.2, sysctl.2, sysfs.2, sysinfo.2, syslog.2, time.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, timerfd_create.2, times.2, tkill.2, truncate.2, umask.2, umount.2, uname.2, unimplemented.2, unlink.2, unshare.2, uselib.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vfork.2, vhangup.2, vm86.2, vmsplice.2, wait.2, wait4.2, write.2, CPU_SET.3, __ppc_get_timebase.3, __ppc_set_ppr_med.3, __ppc_yield.3, __setfpucw.3, a64l.3, abort.3, abs.3, acos.3, acosh.3, addseverity.3, adjtime.3, aio_cancel.3, aio_error.3, aio_fsync.3, aio_read.3, aio_return.3, aio_suspend.3, aio_write.3, alloca.3, argz_add.3, asin.3, asinh.3, asprintf.3, assert.3, assert_perror.3, atan.3, atan2.3, atanh.3, atexit.3, atof.3, atoi.3, backtrace.3, basename.3, bcmp.3, bcopy.3, bindresvport.3, bsd_signal.3, bsearch.3, bstring.3, btowc.3, byteorder.3, bzero.3, cabs.3, cacos.3, cacosh.3, canonicalize_file_name.3, carg.3, casin.3, casinh.3, catan.3, catanh.3, catgets.3, catopen.3, cbrt.3, ccos.3, ccosh.3, ceil.3, cexp.3, cexp2.3, cfree.3, cimag.3, circleq.3, clearenv.3, clock.3, clock_getcpuclockid.3, clog.3, clog10.3, clog2.3, closedir.3, cmsg.3, confstr.3, conj.3, copysign.3, cos.3, cosh.3, cpow.3, cproj.3, creal.3, crypt.3, csin.3, csinh.3, csqrt.3, ctan.3, ctanh.3, ctermid.3, ctime.3, daemon.3, des_crypt.3, difftime.3, dirfd.3, div.3, dl_iterate_phdr.3, dladdr.3, dlerror.3, dlinfo.3, dlopen.3, dlsym.3, drand48.3, drand48_r.3, duplocale.3, dysize.3, ecvt.3, ecvt_r.3, encrypt.3, endian.3, envz_add.3, erf.3, erfc.3, err.3, errno.3, error.3, ether_aton.3, euidaccess.3, exec.3, exit.3, exp.3, exp10.3, exp2.3, expm1.3, fabs.3, fclose.3, fcloseall.3, fdim.3, fenv.3, ferror.3, fexecve.3, fflush.3, ffs.3, fgetc.3, fgetgrent.3, fgetpwent.3, fgetwc.3, fgetws.3, fileno.3, finite.3, flockfile.3, floor.3, fma.3, fmax.3, fmemopen.3, fmin.3, fmod.3, fmtmsg.3, fnmatch.3, fopen.3, fopencookie.3, fpathconf.3, fpclassify.3, fpurge.3, fputwc.3, fputws.3, fread.3, frexp.3, fseek.3, fseeko.3, ftime.3, ftok.3, fts.3, ftw.3, futimes.3, fwide.3, gamma.3, gcvt.3, get_nprocs_conf.3, get_phys_pages.3, getaddrinfo.3, getaddrinfo_a.3, getauxval.3, getcontext.3, getcwd.3, getdate.3, getdirentries.3, getdtablesize.3, getentropy.3, getenv.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getifaddrs.3, getipnodebyname.3, getline.3, getloadavg.3, getlogin.3, getmntent.3, getnameinfo.3, getnetent.3, getnetent_r.3, getopt.3, getpass.3, getprotoent.3, getprotoent_r.3, getpt.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getrpcent_r.3, getrpcport.3, gets.3, getservent.3, getservent_r.3, getspnam.3, getsubopt.3, getttyent.3, getumask.3, getusershell.3, getutent.3, getutmp.3, getw.3, getwchar.3, glob.3, gnu_get_libc_version.3, grantpt.3, group_member.3, gsignal.3, hsearch.3, hypot.3, iconv.3, iconv_close.3, iconv_open.3, if_nameindex.3, if_nametoindex.3, ilogb.3, index.3, inet.3, inet_net_pton.3, inet_ntop.3, inet_pton.3, initgroups.3, insque.3, isalpha.3, isatty.3, isfdtype.3, isgreater.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, j0.3, key_setsecret.3, killpg.3, ldexp.3, lgamma.3, lio_listio.3, list.3, localeconv.3, lockf.3, log.3, log10.3, log1p.3, log2.3, logb.3, login.3, lrint.3, lround.3, lsearch.3, lseek64.3, makecontext.3, makedev.3, mallinfo.3, malloc.3, malloc_get_state.3, malloc_hook.3, malloc_info.3, malloc_stats.3, malloc_trim.3, malloc_usable_size.3, mallopt.3, matherr.3, mblen.3, mbrlen.3, mbrtowc.3, mbsinit.3, mbsnrtowcs.3, mbsrtowcs.3, mbstowcs.3, mbtowc.3, mcheck.3, memccpy.3, memchr.3, memcmp.3, memcpy.3, memfrob.3, memmem.3, memmove.3, mempcpy.3, memset.3, mkdtemp.3, mkfifo.3, mkstemp.3, mktemp.3, modf.3, mpool.3, mq_close.3, mq_getattr.3, mq_notify.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, mtrace.3, nan.3, newlocale.3, nextafter.3, nextup.3, nl_langinfo.3, ntp_gettime.3, on_exit.3, open_memstream.3, opendir.3, openpty.3, perror.3, popen.3, posix_fallocate.3, posix_madvise.3, posix_memalign.3, posix_openpt.3, posix_spawn.3, pow.3, pow10.3, printf.3, profil.3, psignal.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setsigmask_np.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_detach.3, pthread_equal.3, pthread_exit.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_join.3, pthread_kill.3, pthread_kill_other_threads_np.3, pthread_mutex_consistent.3, pthread_mutexattr_getpshared.3, pthread_mutexattr_setrobust.3, pthread_rwlockattr_setkind_np.3, pthread_self.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_setschedprio.3, pthread_sigmask.3, pthread_sigqueue.3, pthread_spin_init.3, pthread_spin_lock.3, pthread_testcancel.3, pthread_tryjoin_np.3, pthread_yield.3, ptsname.3, putenv.3, putgrent.3, putpwent.3, puts.3, putwchar.3, qecvt.3, qsort.3, raise.3, rand.3, random.3, random_r.3, rcmd.3, re_comp.3, readdir.3, readdir_r.3, realpath.3, regex.3, remainder.3, remove.3, remquo.3, resolver.3, rewinddir.3, rexec.3, rint.3, round.3, rpc.3, rpmatch.3, rtime.3, rtnetlink.3, scalb.3, scalbln.3, scandir.3, scanf.3, sched_getcpu.3, seekdir.3, sem_close.3, sem_destroy.3, sem_getvalue.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sem_wait.3, setaliasent.3, setbuf.3, setenv.3, setjmp.3, setlocale.3, setlogmask.3, setnetgrent.3, shm_open.3, siginterrupt.3, signbit.3, significand.3, sigpause.3, sigqueue.3, sigset.3, sigsetops.3, sigvec.3, sigwait.3, sin.3, sincos.3, sinh.3, sleep.3, slist.3, sockatmark.3, sqrt.3, stailq.3, statvfs.3, stdarg.3, stdio.3, stdio_ext.3, stpcpy.3, stpncpy.3, strcasecmp.3, strcat.3, strchr.3, strcmp.3, strcoll.3, strcpy.3, strdup.3, strerror.3, strfmon.3, strfromd.3, strfry.3, strftime.3, string.3, strlen.3, strnlen.3, strpbrk.3, strptime.3, strsep.3, strsignal.3, strspn.3, strstr.3, strtod.3, strtoimax.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, strxfrm.3, swab.3, sysconf.3, syslog.3, system.3, sysv_signal.3, tailq.3, tan.3, tanh.3, tcgetpgrp.3, tcgetsid.3, telldir.3, tempnam.3, termios.3, tgamma.3, timegm.3, timeradd.3, tmpfile.3, tmpnam.3, toascii.3, toupper.3, towctrans.3, towlower.3, towupper.3, trunc.3, tsearch.3, ttyname.3, ttyslot.3, tzset.3, ualarm.3, ulimit.3, undocumented.3, ungetwc.3, unlocked_stdio.3, unlockpt.3, updwtmp.3, uselocale.3, usleep.3, wcpcpy.3, wcpncpy.3, wcrtomb.3, wcscasecmp.3, wcscat.3, wcschr.3, wcscmp.3, wcscpy.3, wcscspn.3, wcsdup.3, wcslen.3, wcsncasecmp.3, wcsncat.3, wcsncmp.3, wcsncpy.3, wcsnlen.3, wcsnrtombs.3, wcspbrk.3, wcsrchr.3, wcsrtombs.3, wcsspn.3, wcsstr.3, wcstoimax.3, wcstok.3, wcstombs.3, wcswidth.3, wctob.3, wctomb.3, wctrans.3, wctype.3, wcwidth.3, wmemchr.3, wmemcmp.3, wmemcpy.3, wmemmove.3, wmemset.3, wordexp.3, wprintf.3, xcrypt.3, xdr.3, y0.3, cciss.4, console_codes.4, dsp56k.4, hpsa.4, initrd.4, loop.4, lp.4, msr.4, random.4, rtc.4, smartpqi.4, veth.4, wavelan.4, acct.5, core.5, elf.5, hosts.5, locale.5, proc.5, resolv.conf.5, rpc.5, slabinfo.5, sysfs.5, tmpfs.5, utmp.5, address_families.7, aio.7, attributes.7, bootparam.7, capabilities.7, cgroups.7, complex.7, ddp.7, environ.7, epoll.7, fanotify.7, feature_test_macros.7, hier.7, inode.7, inotify.7, ip.7, ipv6.7, keyrings.7, locale.7, man-pages.7, man.7, math_error.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, numa.7, packet.7, pkeys.7, pthreads.7, queue.7, raw.7, rtnetlink.7, sched.7, session-keyring.7, shm_overview.7, sigevent.7, signal-safety.7, signal.7, sock_diag.7, socket.7, spufs.7, symlink.7, system_data_types.7, tcp.7, time_namespaces.7, udp.7, udplite.7, unicode.7, unix.7, uri.7, user_namespaces.7, vdso.7, vsock.7, x25.7, iconvconfig.8, ld.so.8, ldconfig.8, sln.8, tzselect.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-22 00:15:34 +01:00
Michael Kerrisk e3e22b2b2b close_range.2: Correct the explanation of the EMFILE error
close_range() CLOSE_RANGE_USHARE triggers a call to dup_fd()
which in turn calls alloc_fdtable(), which checks that
sysctl_nr_open has not been exceeded.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-21 16:37:17 +01:00
Michael Kerrisk 368ace8467 close_range.2: Minor wording fix
Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-21 16:37:17 +01:00
Michael Kerrisk 336bd62ba2 close_range.2: Include a better example program
The current example program can't really be used to demonstrate the
effect of close_range(). Replace it by a program that does show the
effect of this system call.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-21 16:37:17 +01:00
Michael Kerrisk 3bb4fe47a5 close.2: SEE ALSO: add close_range(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-21 16:37:17 +01:00
Michael Kerrisk 8a7d961f0c close_range.2: Minor tweaks to Stephen Kitt's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-21 16:37:17 +01:00
Stephen Kitt bd704558d9 close_range.2: New page documenting close_range(2)
This documents close_range(2) based on information in
278a5fbaed89dacd04e9d052f4594ffd0e0585de,
60997c3d45d9a67daf01c56d805ae4fec37e0bd8, and
582f1fb6b721facf04848d2ca57f34468da1813e.

Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-21 16:37:17 +01:00
Alejandro Colomar b0b19983d9 Various pages: Remove unused <sys/types.h>
The manual pages are already inconsistent in which headers need
to be included.  Right now, not all of the types used by a
function have their required header included in the SYNOPSIS.

If we were to add the headers required by all of the types used by
functions, the SYNOPSIS would grow too much.  Not only it would
grow too much, but the information there would be less precise.

Having system_data_types(7) document each type with all the
information about required includes is much more precise, and the
info is centralized so that it's much easier to maintain.

So let's document only the include required for the function
prototype, and also the ones required for the macros needed to
call the function.

<sys/types.h> only defines types, not functions or constants, so
it doesn't belong to man[23] (function) pages at all.

I ignore if some old systems had headers that required you to
include <sys/types.h> *before* them (incomplete headers), but if
so, those implementations would be broken, and those headers
should probably provide some kind of warning.  I hope this is not
the case.

[mtk: Already in 2001, POSIX.1 removed the requirement to
include <sys/types.h> for many APIs, so this patch seems
well past due.]

Acked-by: Zack Weinberg <zackw@panix.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-15 08:43:12 +01:00
Jens Axboe c245512ad0 man2/openat2.2: Add RESOLVE_CACHED
RESOLVE_CACHED allows an application to attempt a cache-only open
of a file. If this isn't possible, the request will fail with
-1/EAGAIN and the caller should retry without RESOLVE_CACHED set.
This will generally happen from a different context, where a slower
open operation can be performed.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03 23:06:32 +01:00
Michael Kerrisk b007f233f5 kcmp.2: Since Linux 5.12, kcmp() availability is unconditional
kcmp() is no longer dependent on CONFIG_CHECKPOINT_RESTORE.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03 23:06:16 +01:00
edef 04fd7f3121 futex.2: tfix
Signed-off-by: edef <edef@edef.eu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-20 22:46:59 +01:00
edef d089fdeced ptrace.2: tfix
Signed-off-by: edef <edef@edef.eu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-20 15:27:19 +01:00
Jakub Wilk 0dd470d3ee pciconfig_read.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-20 15:15:46 +01:00
Michael Kerrisk d5c5da47bd prctl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-19 14:29:32 +01:00
Alejandro Colomar d8a9e2bbf5 _exit.2: SYNOPSIS: Use 'noreturn' in prototypes
POSIX specifies that _exit() and _Exit() shall not return.
Glibc uses __attribute__((__noreturn__)).
Let's use standard C11 'noreturn' in the manual page.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-19 13:29:34 +01:00
Dmitry V. Levin 1e6910c947 epoll_wait.2: CONFORMING TO: note that epoll_pwait2() is Linux-specific
Mention epoll_pwait2 in "CONFORMING TO" section.

Complements: ba47eb5e3 "epoll_wait.2: Add documentation of epoll_pwait2()"
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-18 08:56:01 +01:00
Michael Kerrisk 7dc3250afc process_madvise.2: Add CONFORMING TO
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-18 08:54:06 +01:00
Alejandro Colomar de85f9235d pciconfig_read.2: SYNOPSIS: Fix prototype parameter types
Use the glibc prototypes instead of the kernel ones.
Exception: use 'int' instead of 'enum'.

......

.../glibc$ grep_glibc_prototype pciconfig_read
sysdeps/unix/sysv/linux/alpha/sys/io.h:72:
extern int pciconfig_read (unsigned long int __bus,
			   unsigned long int __dfn,
			   unsigned long int __off,
			   unsigned long int __len,
			   unsigned char *__buf) __THROW;
sysdeps/unix/sysv/linux/ia64/sys/io.h:57:
extern int pciconfig_read (unsigned long int __bus, unsigned long int __dfn,
			   unsigned long int __off, unsigned long int __len,
			   unsigned char *__buf);
.../glibc$ grep_glibc_prototype pciconfig_write
sysdeps/unix/sysv/linux/alpha/sys/io.h:78:
extern int pciconfig_write (unsigned long int __bus,
			    unsigned long int __dfn,
			    unsigned long int __off,
			    unsigned long int __len,
			    unsigned char *__buf) __THROW;
sysdeps/unix/sysv/linux/ia64/sys/io.h:61:
extern int pciconfig_write (unsigned long int __bus, unsigned long int __dfn,
			    unsigned long int __off, unsigned long int __len,
			    unsigned char *__buf);
.../glibc$ grep_glibc_prototype pciconfig_iobase
sysdeps/unix/sysv/linux/alpha/sys/io.h:66:
extern long pciconfig_iobase(enum __pciconfig_iobase_which __which,
			     unsigned long int __bus,
			     unsigned long int __dfn)
     __THROW __attribute__ ((const));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 21:11:29 +01:00
Alejandro Colomar 2b83f49313 vmsplice.2: SYNOPSIS: Fix prototype parameter type
The 3rd parameter of vmsplice() uses 'size_t' in glibc.  Fix it.

......

.../gnu/glibc$ grep_glibc_prototype vmsplice
sysdeps/unix/sysv/linux/bits/fcntl-linux.h:391:
extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
			   size_t __count, unsigned int __flags);
.../gnu/glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 21:10:47 +01:00
Alejandro Colomar 0ce020a3f6 lookup_dcookie.2: Use standard types: u64 -> uint64_t
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:58:43 +01:00
Alejandro Colomar 5de448e93c tkill.2: SYNOPSIS: Fix prototype parameter types
All but the last parameters of t[g]kill() use 'pid_t',
both in the kernel and glibc.  Fix them.

......

.../linux/linux$ grep_syscall tkill
kernel/signal.c:3870:
SYSCALL_DEFINE2(tkill, pid_t, pid, int, sig)
include/linux/syscalls.h:685:
asmlinkage long sys_tkill(pid_t pid, int sig);
.../linux/linux$

.../gnu/glibc$ grep_glibc_prototype tgkill
sysdeps/unix/sysv/linux/bits/signal_ext.h:29:
extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal);
.../gnu/glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:58:20 +01:00
Alejandro Colomar beb7a3c10e spu_run.2: SYNOPSIS: Fix prototype parameter types
The 2nd and 3rd parameters of spu_run() use 'uint32_t *'.  Fix it.

......

.../linux$ grep_syscall spu_run
arch/powerpc/platforms/cell/spu_syscalls.c:80:
SYSCALL_DEFINE3(spu_run,int, fd, __u32 __user *, unpc, __u32 __user *, ustatus)
include/linux/syscalls.h:1034:
asmlinkage long sys_spu_run(int fd, __u32 __user *unpc,
				 __u32 __user *ustatus);
.../linux$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:57:56 +01:00
Alejandro Colomar 0a37ff53bc spu_create.2: SYNOPSIS: Fix prototype parameter type
The 'flags' parameter of spu_create() uses 'unsigned int'.  Fix it.

......

.../linux$ grep_syscall spu_create
arch/powerpc/platforms/cell/spu_syscalls.c:56:
SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags,
	umode_t, mode, int, neighbor_fd)
include/linux/syscalls.h:1036:
asmlinkage long sys_spu_create(const char __user *name,
		unsigned int flags, umode_t mode, int fd);
.../linux$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:57:36 +01:00
Alejandro Colomar 9bebb17e5b splice.2: Use 'off64_t' instead of 'loff_t'
The kernel syscall uses 'loff_t', but the glibc wrapper uses 'off64_t'.
Let's document the wrapper prototype, as in other pages.

......

.../glibc$ grep_glibc_prototype splice
sysdeps/unix/sysv/linux/bits/fcntl-linux.h:398:
extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
			 __off64_t *__offout, size_t __len,
			 unsigned int __flags);
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:57:19 +01:00
Alejandro Colomar 8494be5e85 setfsgid.2: tfix
The type of fsgid is git_t, and not uid_t.  Fix it.

......

.../glibc$ grep_glibc_prototype setfsgid
sysdeps/unix/sysv/linux/sys/fsuid.h:31:
extern int setfsgid (__gid_t __gid) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:53:35 +01:00
Michael Kerrisk 0181a85a16 socketcall.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:52:43 +01:00
Michael Kerrisk ccb8164053 socketcall.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:52:24 +01:00
Alejandro Colomar fa50e1599e socketcall.2: Add note about missing glibc wrapper
......

.../glibc$ grep_glibc_prototype socketcall
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:51:31 +01:00
Alejandro Colomar 2e5ae1b775 sched_setattr.2: Add note about missing glibc wrappers
......

.../glibc$ grep_glibc_prototype sched_setattr
.../glibc$ grep_glibc_prototype sched_getattr
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:50:19 +01:00
Alejandro Colomar 449e4dc9fc s390_pci_mmio_write.2: SYNOPSIS: Add 'const' qualifier
s390_pci_mmio_write() uses 'const void *' instead of 'void *'.
Fix it.

......

.../linux$ grep_syscall s390_pci_mmio_write
arch/s390/pci/pci_mmio.c:119:
SYSCALL_DEFINE3(s390_pci_mmio_write, unsigned long, mmio_addr,
		const void __user *, user_buffer, size_t, length)
.../linux$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:49:50 +01:00
Jakub Wilk 86f733b4d8 execve.2: spfix
"Mibibytes" is a misspelling of "mebibytes",
but let's use more familiar "MiB" instead.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 20:47:37 +01:00
Michael Kerrisk 5232ea0fab rename.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-15 13:45:19 +01:00
Gabriel Krisman Bertazi 131ee1e1de prctl.2: Document Syscall User Dispatch
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 13:09:08 +01:00
Dmitry V. Levin 8a6b6cb878 epoll_pwait2.2: New link to epoll_wait(2)
Complements: ba47eb5e3 "epoll_wait.2: Add documentation of epoll_pwait2()"
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 09:36:17 +01:00
Palmer Dabbelt 33f776b54c execve.2: Correct the versions of Linux that don't have ARG_MAX argv/envp size
I just happened upon this inconsistent text while reading `man 2
execve`.  The code in question landed in 2.6.23 as b6a2fea39318
("mm: variable length argument support").

Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 09:01:17 +01:00
Alejandro Colomar d14c4ba412 timer_settime.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of timer_settime()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype timer_settime
time/time.h:242:
extern int timer_settime (timer_t __timerid, int __flags,
			  const struct itimerspec *__restrict __value,
			  struct itimerspec *__restrict __ovalue) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar 3b184f9c85 timer_create.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of timer_create()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype timer_create
time/time.h:234:
extern int timer_create (clockid_t __clock_id,
			 struct sigevent *__restrict __evp,
			 timer_t *__restrict __timerid) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar caed1954a1 stat.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of stat(), lstat(), and fstatat()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype stat
io/sys/stat.h:205:
extern int stat (const char *__restrict __file,
		 struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
.../glibc$ grep_glibc_prototype lstat
io/sys/stat.h:259:
extern int lstat (const char *__restrict __file,
		  struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
.../glibc$ grep_glibc_prototype fstatat
io/sys/stat.h:234:
extern int fstatat (int __fd, const char *__restrict __file,
		    struct stat *__restrict __buf, int __flag)
     __THROW __nonnull ((2, 3));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar 049d7f92e8 statx.2: SYNOPSIS: Use 'restrict' in prototypes
Glibc uses 'restrict' for the types of the parameters of statx().
Let's use it here too.

......

.../glibc$ grep_glibc_prototype statx
io/bits/statx-generic.h:60:
int statx (int __dirfd, const char *__restrict __path, int __flags,
           unsigned int __mask, struct statx *__restrict __buf)
  __THROW __nonnull ((2, 5));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar c59ca53abd sigwaitinfo.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of sigwaitinfo()
and sigtimedwait() shall be 'restrict'.
Glibc uses 'restrict' too.  Let's use it here too.

......

.../glibc$ grep_glibc_prototype sigwaitinfo
signal/signal.h:264:
extern int sigwaitinfo (const sigset_t *__restrict __set,
			siginfo_t *__restrict __info) __nonnull ((1));
.../glibc$ grep_glibc_prototype sigtimedwait
signal/signal.h:272:
extern int sigtimedwait (const sigset_t *__restrict __set,
			 siginfo_t *__restrict __info,
			 const struct timespec *__restrict __timeout)
     __nonnull ((1));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar 1c227750c0 sigprocmask.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of sigprocmask()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype sigprocmask
signal/signal.h:232:
extern int sigprocmask (int __how, const sigset_t *__restrict __set,
			sigset_t *__restrict __oset) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar c1603508a1 sigaltstack.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of sigaltstack()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype sigaltstack
signal/signal.h:320:
extern int sigaltstack (const stack_t *__restrict __ss,
			stack_t *__restrict __oss) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar 3d54c17a6d sigaction.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of sigaction()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype sigaction
signal/signal.h:243:
extern int sigaction (int __sig, const struct sigaction *__restrict __act,
		      struct sigaction *__restrict __oact) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar 6b032bf01e select.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of [p]select()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype select
misc/sys/select.h:101:
extern int select (int __nfds, fd_set *__restrict __readfds,
		   fd_set *__restrict __writefds,
		   fd_set *__restrict __exceptfds,
		   struct timeval *__restrict __timeout);
.../glibc$ grep_glibc_prototype pselect
misc/sys/select.h:113:
extern int pselect (int __nfds, fd_set *__restrict __readfds,
		    fd_set *__restrict __writefds,
		    fd_set *__restrict __exceptfds,
		    const struct timespec *__restrict __timeout,
		    const __sigset_t *__restrict __sigmask);
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar 04dc013d9b recv.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of recvfrom()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype recvfrom
socket/sys/socket.h:163:
extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
			 int __flags, __SOCKADDR_ARG __addr,
			 socklen_t *__restrict __addr_len);
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar 8f5b718ea1 readlink.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of readlink() and readlinkat()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype readlink
posix/unistd.h:820:
extern ssize_t readlink (const char *__restrict __path,
			 char *__restrict __buf, size_t __len)
     __THROW __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3));
.../glibc$ grep_glibc_prototype readlinkat
posix/unistd.h:832:
extern ssize_t readlinkat (int __fd, const char *__restrict __path,
			   char *__restrict __buf, size_t __len)
     __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar 78eb47fc8f getsockopt.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of getsockopt()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype getsockopt
socket/sys/socket.h:208:
extern int getsockopt (int __fd, int __level, int __optname,
		       void *__restrict __optval,
		       socklen_t *__restrict __optlen) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar 8de93cea54 getpeername.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies that the parameters of getpeername()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype getpeername
socket/sys/socket.h:130:
extern int getpeername (int __fd, __SOCKADDR_ARG __addr,
			socklen_t *__restrict __len) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Alejandro Colomar e234eef0c6 accept.2: SYNOPSIS: Use 'restrict' in prototypes
POSIX specifies the parameters of accept() shall be 'restrict'.
Glibc uses 'restrict' too (also for accept4()).
Let's use it here too.

......

.../glibc$ grep_glibc_prototype accept
socket/sys/socket.h:232:
extern int accept (int __fd, __SOCKADDR_ARG __addr,
		   socklen_t *__restrict __addr_len);
.../glibc$ grep_glibc_prototype accept4
socket/sys/socket.h:240:
extern int accept4 (int __fd, __SOCKADDR_ARG __addr,
		    socklen_t *__restrict __addr_len, int __flags);
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-14 08:53:59 +01:00
Michael Kerrisk bb5d2db62e process_madvise.2: Consistently use the term 'advice'
The page used 'hint' and 'advice' synonymously. This leaves the
reader wondering if the terms mean the same thing, or different
things. They mean the same thing, so use just one term.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-13 23:03:06 +01:00
Michael Kerrisk c049935731 process_madvise.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-13 23:03:06 +01:00
Michael Kerrisk c7faf9452e process_madvise.2: Defer to madvise(2) for description of 'advice' flags
Rather than repeating the description of MADV_COLD and MADV_PAGEOUT
in two pages, centralize the discussion in madvise(2), and refer
from process_madvise(2) ro madvise(2).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-13 23:03:06 +01:00
Michael Kerrisk c9c9ab2e69 madvise.2: Add descriptions of MADV_COLD and MADV_PAGEOUT
Taken from process_madvise(2).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-13 23:03:03 +01:00
Michael Kerrisk 8d010a0673 process_madvise.2: Minor clarification regarding partial advice scenario
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-13 21:10:04 +01:00
Alejandro Colomar 147ad5cedc process_madvise.2: SYNOPSIS: Fix prototype parameter type
The type of vlen is 'size_t', and not 'unsigned int'.  Fix it.

......

$ grep_syscall process_madvise
mm/madvise.c:1161:
SYSCALL_DEFINE5(process_madvise, int, pidfd, const struct iovec __user *, vec,
		size_t, vlen, int, behavior, unsigned int, flags)
include/linux/syscalls.h:887:
asmlinkage long sys_process_madvise(int pidfd, const struct iovec __user *vec,
			size_t vlen, int behavior, unsigned int flags);

function grep_syscall()
{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.c$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';

	find * -type f \
	|grep '\.[ch]$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-13 16:44:46 +01:00
Alejandro Colomar 904291a421 process_madvise.2: Add note about missing glibc wrapper
Glibc bug: <https://sourceware.org/bugzilla/show_bug.cgi?id=27380>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-13 16:42:18 +01:00
Alejandro Colomar 4f1adaa493 move_pages.2: Add notes about missing glibc wrappers
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-13 16:38:19 +01:00
Alyssa Ross 7a0095a542 open.2, rename.2: Refer to tmpfs rather than shmem
Skimming open(2), I was surprised not to see tmpfs mentioned as a
filesystem supported by O_TMPFILE.

If I'm understanding correctly (I'm very possibly not!), tmpfs is
a filesystem built on shmem, so I think it's more correct (and
probably much more widely understandable) to refer to tmpfs here.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-10 22:07:30 +01:00
Michael Kerrisk 788c381c4b rename.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-10 22:05:34 +01:00
Alejandro Colomar 8ccbd769d0 mmap2.2: Fix prototype parameter types
There are many slightly different prototypes for this syscall,
but none of them is like the documented one.
Of all the different prototypes,
let's document the asm-generic one.

This manual page was actually using a prototype similar to
mmap(2), but there's no glibc wrapper function called mmap2(2),
as the wrapper for this syscall is mmap(2).  Therefore, the
documented prototype should be the kernel one.

......

.../linux$ grep_syscall mmap2
arch/csky/kernel/syscall.c:17:
SYSCALL_DEFINE6(mmap2,
	unsigned long, addr,
	unsigned long, len,
	unsigned long, prot,
	unsigned long, flags,
	unsigned long, fd,
	off_t, offset)
arch/microblaze/kernel/sys_microblaze.c:46:
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
		unsigned long, prot, unsigned long, flags, unsigned long, fd,
		unsigned long, pgoff)
arch/nds32/kernel/sys_nds32.c:12:
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
	       unsigned long, prot, unsigned long, flags,
	       unsigned long, fd, unsigned long, pgoff)
arch/powerpc/kernel/syscalls.c:60:
SYSCALL_DEFINE6(mmap2, unsigned long, addr, size_t, len,
		unsigned long, prot, unsigned long, flags,
		unsigned long, fd, unsigned long, pgoff)
arch/riscv/kernel/sys_riscv.c:37:
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
	unsigned long, prot, unsigned long, flags,
	unsigned long, fd, off_t, offset)
arch/s390/kernel/sys_s390.c:49:
SYSCALL_DEFINE1(mmap2, struct s390_mmap_arg_struct __user *, arg)
arch/sparc/kernel/sys_sparc_32.c:101:
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
	unsigned long, prot, unsigned long, flags, unsigned long, fd,
	unsigned long, pgoff)
arch/ia64/include/asm/unistd.h:30:
asmlinkage unsigned long sys_mmap2(
				unsigned long addr, unsigned long len,
				int prot, int flags,
				int fd, long pgoff);
arch/ia64/kernel/sys_ia64.c:139:
asmlinkage unsigned long
sys_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, long pgoff)
arch/m68k/kernel/sys_m68k.c:40:
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
	unsigned long prot, unsigned long flags,
	unsigned long fd, unsigned long pgoff)
arch/parisc/kernel/sys_parisc.c:275:
asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len,
	unsigned long prot, unsigned long flags, unsigned long fd,
	unsigned long pgoff)
arch/powerpc/include/asm/syscalls.h:15:
asmlinkage long sys_mmap2(unsigned long addr, size_t len,
		unsigned long prot, unsigned long flags,
		unsigned long fd, unsigned long pgoff);
arch/sh/include/asm/syscalls.h:8:
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
			  unsigned long prot, unsigned long flags,
			  unsigned long fd, unsigned long pgoff);
arch/sh/kernel/sys_sh.c:41:
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
	unsigned long prot, unsigned long flags,
	unsigned long fd, unsigned long pgoff)
arch/sparc/kernel/systbls.h:23:
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
			  unsigned long prot, unsigned long flags,
			  unsigned long fd, unsigned long pgoff);
include/asm-generic/syscalls.h:14:
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
			unsigned long prot, unsigned long flags,
			unsigned long fd, unsigned long pgoff);
.../linux$

function grep_syscall()
{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.c$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';

	find * -type f \
	|grep '\.[ch]$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-09 19:39:47 +01:00
Alejandro Colomar 5ae403a2d4 mlock.2: mlock2(): Fix prototype parameter types
The documented prototype for mlock2() was a mix of the
glibc wrapper prototype and the kernel syscall prototype.
Let's document the glibc wrapper prototype, which is shown below.

......

.../glibc$ grep_glibc_prototype mlock2
sysdeps/unix/sysv/linux/bits/mman-shared.h:55:
int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW;
.../glibc$

function grep_glibc_prototype()
{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <func>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.h$' \
	|sort -V \
	|xargs pcregrep -Mn \
	  "(?s)^[^\s#][\w\s]+\s+\**${1}\s*\([\w\s()[\]*,]*?(...)?\)[\w\s()]*;" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-09 19:37:28 +01:00
Michael Kerrisk 4791875270 execveat.2: srcfix: add a link to glibc bug requesting wrapper
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-09 19:35:53 +01:00
Alejandro Colomar 71a25d4c79 execveat.2: Fix prototype
It's been 6 years since execveat(2) was added to the kernel,
and there's still no glibc wrapper.  Let's document the kernel
syscall prototype.

I reported a bug against glibc requesting a wrapper;
when glibc adds the wrapper, this commit should probably be
reverted.

......

.../linux$ grep_syscall execveat
fs/exec.c:2062:
SYSCALL_DEFINE5(execveat,
		int, fd, const char __user *, filename,
		const char __user *const __user *, argv,
		const char __user *const __user *, envp,
		int, flags)
fs/exec.c:2083:
COMPAT_SYSCALL_DEFINE5(execveat, int, fd,
		       const char __user *, filename,
		       const compat_uptr_t __user *, argv,
		       const compat_uptr_t __user *, envp,
		       int,  flags)
include/linux/compat.h:815:
asmlinkage long compat_sys_execveat(int dfd, const char __user *filename,
		     const compat_uptr_t __user *argv,
		     const compat_uptr_t __user *envp, int flags);
include/linux/syscalls.h:980:
asmlinkage long sys_execveat(int dfd, const char __user *filename,
			const char __user *const __user *argv,
			const char __user *const __user *envp, int flags);
.../linux$

function grep_syscall()
{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.c$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';

	find * -type f \
	|grep '\.[ch]$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Glibc bug: <https://sourceware.org/bugzilla/show_bug.cgi?id=27364>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-09 19:33:47 +01:00
Alejandro Colomar 56d1311b87 ipc.2: Fix prototype parameter types
The types for some of the parameters are incorrect
(different than the kernel).  Fix them.
Below are shown the types that the kernel uses.

......

.../linux$ grep_syscall ipc
ipc/syscall.c:110:
SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second,
		unsigned long, third, void __user *, ptr, long, fifth)
ipc/syscall.c:205:
COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second,
	u32, third, compat_uptr_t, ptr, u32, fifth)
include/linux/compat.h:874:
asmlinkage long compat_sys_ipc(u32, int, int, u32, compat_uptr_t, u32);
include/linux/syscalls.h:1221:
asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,
		unsigned long third, void __user *ptr, long fifth);
.../linux$

function grep_syscall()
{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.c$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';

	find * -type f \
	|grep '\.[ch]$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-09 19:26:49 +01:00
Jonathan Wakely 055811a99e stat.2: Remove <unistd.h> from synopsis
There seems to be no reason <unistd.h> is shown here, so remove it.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-09 13:27:59 +01:00
Michael Kerrisk ba50f49c69 getpriority.2, recv.2, fts.3: wfix
These pages have the odd wording 'the external variable errno',
which does not occur in other pages. Make these pages conform with
the norm.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-07 12:01:36 +01:00
Michael Kerrisk c9b9a599fc ipc.2: Minor tweak to Alex's patch regarding use of syscall()
Calling ipc() directly would be a rather unusual thing to do,
so add some text to emphasize that point.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-06 21:46:48 +01:00
Alejandro Colomar fa646e185f bdflush.2, capget.2, get_mempolicy.2, ipc.2, lookup_dcookie.2, mbind.2, migrate_pages.2: Add notes about missing glibc wrappers
.../glibc$ grep_syscall_wrapper bdflush
.../glibc$ grep_syscall_wrapper capget
.../glibc$ grep_syscall_wrapper capset
.../glibc$ grep_syscall_wrapper get_mempolicy
.../glibc$ grep_syscall_wrapper ipc
.../glibc$ grep_syscall_wrapper lookup_dcookie
.../glibc$ grep_syscall_wrapper mbind
.../glibc$ grep_syscall_wrapper migrate_pages
.../glibc$

function grep_syscall_wrapper()
{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.h$' \
	|sort -V \
	|xargs pcregrep -Mn \
	  "(?s)^[^\s#][\w\s]+\s+\**${1}\s*\([\w\s()[\]*,]*?(...)?\)[\w\s()]*;" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-06 21:45:41 +01:00
Alejandro Colomar 3d18bee298 getsockname.2: Use restrict in prototypes
POSIX specifies that the 2nd and 3rd parameters to getsockname()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_syscall_wrapper getsockname
socket/sys/socket.h:116:
extern int getsockname (int __fd, __SOCKADDR_ARG __addr,
			socklen_t *__restrict __len) __THROW;
.../glibc$ grep -rn '# *define __SOCKADDR_ARG'
socket/sys/socket.h:58:
 # define __SOCKADDR_ARG		struct sockaddr *__restrict
.../glibc$

function grep_syscall_wrapper()
{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.h$' \
	|sort -V \
	|xargs pcregrep -Mn \
	  "(?s)^[^\s#][\w\s]+\s+\**${1}\s*\([\w\s()[\]*,]*?(...)?\)[\w\s()]*;" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-06 21:39:59 +01:00
Alejandro Colomar 1b213b4fa4 gettimeofday.2: Use restrict in prototypes
POSIX specifies that the parameters of gettimeofday() shall be
'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_syscall_wrapper gettimeofday
time/sys/time.h:66:
extern int gettimeofday (struct timeval *__restrict __tv,
			 void *__restrict __tz) __THROW __nonnull ((1));
.../glibc$

function grep_syscall_wrapper()
{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.h$' \
	|sort -V \
	|xargs pcregrep -Mn \
	  "(?s)^[^\s#][\w\s]+\s+\**${1}\s*\([\w\s()[\]*,]*?(...)?\)[\w\s()]*;" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-06 21:38:53 +01:00
Alejandro Colomar eaaa85c17c getitimer.2: Use restrict in prototypes
POSIX specifies that the 2nd and 3rd parameters to setitimer()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_syscall_wrapper setitimer
time/sys/time.h:129:
extern int setitimer (__itimer_which_t __which,
		      const struct itimerval *__restrict __new,
		      struct itimerval *__restrict __old) __THROW;
.../glibc$

function grep_syscall_wrapper()
{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.h$' \
	|sort -V \
	|xargs pcregrep -Mn \
	  "^[^\s][\w\s]+\s+\**${1}\s*\((?s)[\w\s()[\]*,]*?(...)?\)[\w\s()]*;" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-06 21:37:34 +01:00
Alejandro Colomar cb4baea939 epoll_wait.2: srcfix: glibc doesn't provide epoll_pwait2() yet
I filed a bug against glibc
requesting the wrapper for the new syscall.

Glibc bug: <https://sourceware.org/bugzilla/show_bug.cgi?id=27359>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-06 21:34:45 +01:00
Michael Kerrisk b926779b33 getgid.2, getuid.2: Note that these interfaces never modify 'errno'
See https://www.austingroupbugs.net/view.php?id=511
and the POSIX.1-2008 specifications of the interfaces.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-06 10:38:57 +01:00
Alejandro Colomar 2a8c925ba8 s390_guarded_storage.2: tfix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-04 22:36:46 +01:00
Michael Kerrisk 3aac0708a9 process_madvise.2: Restructure the text in DESCRIPTION a little
The 'advice' subsection fell in the middle of other text in the
DESCRIPTION, which is a little confusing. Instead, move that
subsection to the end of the DESCRIPTION, and make some other
minor text reorganization so that related details are placed in
the same paragraphs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-02 11:43:15 +01:00
Michael Kerrisk e3ce016472 process_madvise.2: Minor edits to Suren Baghdasaryan's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-02 11:43:15 +01:00
Michael Kerrisk 81ec67d804 madvise.2: SEE ALSO: add process_madvise(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-02 11:43:15 +01:00
Michael Kerrisk 790593b4ae pidfd_open.2: Note the process_madvise(2) use case for PID file descriptors
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-02 11:43:15 +01:00
Suren Baghdasaryan a144f458ba process_madvise.2: Document process_madvise(2)
Initial version of process_madvise(2) manual page. Initial text
was extracted from [1], amended after fix [2] and more details
added using man pages of madvise(2) and process_vm_readv(2) as
examples. It also includes the changes to required permission
proposed in [3].

[1] https://lore.kernel.org/patchwork/patch/1297933/
[2] https://lkml.org/lkml/2020/12/8/1282
[3] https://patchwork.kernel.org/project/selinux/patch/20210111170622.2613577-1-surenb@google.com/#23888311

Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-02 11:43:00 +01:00
Michael Kerrisk 1543da430a shmget.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-28 14:10:42 +01:00
Michael Kerrisk 09c6d6ca72 access.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-28 14:10:10 +01:00
Michael Kerrisk 02576fcb1c mmap.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-28 14:08:52 +01:00
Jakub Wilk 29dee4ce10 semget.2, shm_open.3: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-24 23:33:35 +01:00
Alejandro Colomar 48c3ffa776 kexec_load.2: srcfix: Don't break a line that doesn't get past the right margin
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-24 23:31:41 +01:00
Michael Kerrisk cd415e7364 Various pages: use "\-" to generate real minus in circumstances where appropriate
Use \- for math formulas, pathnames, manual page cross references,
etc.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-21 10:53:59 +01:00
Michael Kerrisk b49c2acb42 Various pages: use real minus signs in pathnames
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-21 10:29:14 +01:00
Michael Kerrisk d064d41a4b Various pages: Inside code blocks (.EX/.EE) use \- to get real minus signs
A real minus can be cut and pasted...

THere are a few exceptions that gave been excluded in the this
change.  For example, where there' is a string such as "<p1-name>",
where p1-name is soome sort of pseudo-identifier.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-21 10:29:14 +01:00
Michael Kerrisk c43f976fd8 mount.2: Note that the 'data' argument can be NULL
Verified from reading the kernel source and looking at the source
of mount(8). Surprisingly, this has not documented after so many
years.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-20 13:12:33 +01:00
Johannes Wellhöfer 2a1b1111ca clone.2: tfix
For the alternate signal stack to be cleared, CLONE_VM should and
CLONE_VFORK should not be specified.

[mtk: fixes my commit 52e5819c41]

Signed-off-by: Johannes Wellhöfer <johannes.wellhofer@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-19 08:54:41 +01:00
Jakub Wilk cf14bdbde1 cacheflush.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-18 16:58:48 +01:00
Alejandro Colomar d51b60ac01 execveat.2: Normalize notes about missing wrappers
It's been a long time sine kernel 3.19.
There's still no glibc wrapper.

......

$ grep -rn 'execveat *(' glibc/
$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-17 21:55:12 +01:00
Alejandro Colomar d75c2ffe21 cacheflush.2: Update SYNOPSIS for glibc wrapper
Glibc uses 'void *' instead of 'char *'.
And the prototype is declared in <sys/cachectl.h>.

......

$ syscall='cacheflush';
$ ret='int';
$ find glibc/ -type f -name '*.h' \
  |xargs pcregrep -Mn "(?s)^[\w\s]*${ret}\s*${syscall}\s*\(.*?;";
glibc/sysdeps/unix/sysv/linux/nios2/sys/cachectl.h:27:
extern int cacheflush (void *__addr, const int __nbytes, const int __op) __THROW;
glibc/sysdeps/unix/sysv/linux/mips/sys/cachectl.h:35:
extern int cacheflush (void *__addr, const int __nbytes, const int __op) __THROW;
glibc/sysdeps/unix/sysv/linux/arc/sys/cachectl.h:30:
extern int cacheflush (void *__addr, int __nbytes, int __op) __THROW;
glibc/sysdeps/unix/sysv/linux/csky/sys/cachectl.h:30:
extern int cacheflush (void *__addr, const int __nbytes,
		       const int __op) __THROW;

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-17 21:55:12 +01:00
Michael Kerrisk 5efa68d57d epoll_wait.2: Minor tweaks to Willem de Bruijn's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-12 08:19:51 +01:00
Willem de Bruijn ba47eb5e3c epoll_wait.2: Add documentation of epoll_pwait2()
Expand the epoll_wait() page with epoll_pwait2(), an epoll_wait()
variant that takes a struct timespec to enable nanosecond
resolution timeout.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-12 08:07:56 +01:00
Valentin Kettner e71d103b2c clone.2: Fix types in clone_args
A file descriptor is an int so it should be stored through an int
pointer while parent_tid should have the same type as child_tid
which is pid_t pointer.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-11 09:17:47 +01:00
Michael Kerrisk 0a23e9aac0 mprotect.2, readv.2, sigaltstack.2, sigreturn.2, ctime.3, scandir.3, random.4, pkeys.7: ffix: s/-1/\-1/
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 22:08:50 +01:00
Michael Kerrisk 9fd0c2f252 mlock.2: CONFORMING TO: note more explicitly which APIs are in the standards
The current wording is a little unclear...

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 20:57:09 +01:00
Michael Kerrisk 45e399e7f8 alloc_hugepages.2: CONFORMING TO: reword to reflect that these system calls are long gone
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 20:52:49 +01:00
Michael Kerrisk e4c07f6482 epoll_create.2: CONFORMING TO: mention also that epoll_create1() is Linux-specific
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 20:49:43 +01:00
Michael Kerrisk f7f02d0f8d epoll_wait.2: CONFORMING TO: mention also that epoll_pwait() is Linux-specific
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 20:47:47 +01:00
Michael Kerrisk 3d81c05a79 time.1, ioctl_console.2, daemon.3, updwtmp.3, mouse.4, smartpqi.4: tfix (Oxford comma)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 12:53:15 +01:00
Michael Kerrisk 36dce68747 open.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 12:30:48 +01:00
Michael Kerrisk 3ded684c1a Various pages: tfix (Oxford comma)
Found using:

    git grep -lE '^[^.].*,.*,.*[^,] (and|or)\>'

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 11:15:26 +01:00
Michael Kerrisk 735334d454 Various pages: tfix (Oxford comma)
Discovered using:

    git grep -lE '^[^.].*, [^ ]*[^,] (or|and)\>'

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 11:02:33 +01:00
Michael Kerrisk e8d28f7cc9 ioctl_fslabel.2, ioctl_fideduperange.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 10:34:46 +01:00
Michael Kerrisk f2fa055834 ioctl_console.2, msgctl.2, msgget.2, msgop.2, semctl.2, semget.2, semop.2, shm_open.3, shmget.2, shmop.2: ERRORS: remove redundant statement that 'errno' is set
This is implied in every other manual page. There is no need to
state it explicitly in these pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 10:21:57 +01:00
Michael Kerrisk d9b17b7371 semget.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 10:14:48 +01:00
Michael Kerrisk 73b81e53fe write.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 09:59:10 +01:00
Michael Kerrisk 2df7ea6cd8 getsid.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 09:57:41 +01:00
Michael Kerrisk 95887a0039 clone.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 09:51:59 +01:00
Michael Kerrisk 2c916a1d3c Various pages: Remove redundant "\\ " to escape spaces
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-08 13:42:27 +01:00