Commit Graph

8995 Commits

Author SHA1 Message Date
Michael Kerrisk fe2764329d getpriority.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-27 09:28:11 +01:00
Michael Kerrisk 373a3de56d link.2: ffix
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-26 13:52:15 +01:00
Mathias Rav 336be2e745 link.2: ERRORS: add ENOENT when target is deleted
Linux kernel commit aae8a97d3ec30788790d1720b71d76fd8eb44b73 (part
of kernel release v2.6.39) added a check to disallow creating a
hardlink to an unlinked file.

The manual page already describes the trick of using
AT_SYMLINK_FOLLOW as an alternative to AT_EMPTY_PATH, and for
AT_EMPTY_PATH the manual page already notes that it "will
generally not work if the file has a link count of zero". However,
the precise error (ENOENT) is not mentioned, and the error case
isn't mentioned in the ERRORS section at all.

This makes it easy to overlook the fact that the AT_SYMLINK_FOLLOW
trick on /proc/self/fd/NN won't work on deleted files, as
evidenced by the follow message (which turns up when googling
"linkat deleted ENOENT"):
https://groups.google.com/g/linux.kernel/c/zZO4lqqwp64

Signed-off-by: Mathias Rav <m@git.strova.dk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-26 10:58:54 +01:00
Michael Kerrisk 32a72b3e1b pivot_root.2: tfix
Reported-by: Davide Giorgio <davide@giorgiodavide.it>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-26 10:30:35 +01:00
Michael Kerrisk 6e94330a07 getrusage.2: Note that the 'vtimes' symbol exists only up to glibc 2.32
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-25 23:42:44 +01:00
Alejandro Colomar 36ded6fe89 set_tid_address.2: SYNOPSIS: Fix set_tid_address() return type
The Linux kernel uses 'pid_t' instead of 'long' for the return type.
As glibc provides no wrapper, use the same types the kernel uses.

$ sed -n 34,36p man-pages/man2/set_tid_address.2
.PP
.IR Note :
There is no glibc wrapper for this system call; see NOTES.

$ grep -rn 'SYSCALL_DEFINE.*set_tid_address' linux/
linux/kernel/fork.c:1632:
SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr)

$ sed -n 1632,1638p linux/kernel/fork.c
SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr)
{
	current->clear_child_tid = tidptr;

	return task_pid_vnr(current);
}

$ grep -rn 'task_pid_vnr(struct' linux/
linux/include/linux/sched.h:1374:
static inline pid_t task_pid_vnr(struct task_struct *tsk)

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-24 10:49:48 +01:00
Alejandro Colomar 701b2272cd restart_syscall.2: SYNOPSIS: Fix restart_syscall() return type
The Linux kernel uses 'long' instead of 'int' for the return type.
As glibc provides no wrapper, use the same types the kernel uses.

$ grep -rn 'SYSCALL_DEFINE.*(restart_syscall'
kernel/signal.c:2891:SYSCALL_DEFINE0(restart_syscall)

$ sed -n 2891,2895p kernel/signal.c
SYSCALL_DEFINE0(restart_syscall)
{
	struct restart_block *restart = &current->restart_block;
	return restart->fn(restart);
}

$ grep -rn 'struct restart_block {'
include/linux/restart_block.h:25:struct restart_block {

$ sed -n 25,56p include/linux/restart_block.h
struct restart_block {
	long (*fn)(struct restart_block *);
	union {
		/* For futex_wait and futex_wait_requeue_pi */
		struct {
			u32 __user *uaddr;
			u32 val;
			u32 flags;
			u32 bitset;
			u64 time;
			u32 __user *uaddr2;
		} futex;
		/* For nanosleep */
		struct {
			clockid_t clockid;
			enum timespec_type type;
			union {
				struct __kernel_timespec __user *rmtp;
				struct old_timespec32 __user *compat_rmtp;
			};
			u64 expires;
		} nanosleep;
		/* For poll */
		struct {
			struct pollfd __user *ufds;
			int nfds;
			int has_timeout;
			unsigned long tv_sec;
			unsigned long tv_nsec;
		} poll;
	};
};

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 22:52:30 +01:00
Michael Kerrisk 7c1a416d65 llseek.2: Point the reader to lseek64(3) for info about llseek(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 07:18:43 +01:00
Michael Kerrisk 48a830d7c8 llseek.2: Note size of 'loff_t' type
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-23 07:11:13 +01:00
Michael Kerrisk 940a0979de llseek.2: Some mild rewriting to ease reading of the info in this page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-22 07:34:56 +01:00
Alejandro Colomar e7ff75357d capget.2, execve.2, readv.2, socketpair.2, utime.2, utimensat.2, getloadavg.3, proc.5, mount_namespaces.7, unix.7: ffix
{.IR var [x]} -> {.I var[x]}

There were around 15 entries of the former,
and around 360 of the latter.

Found using:
$ grep -rn '^\.I[ |R].* \[.*\]' |sort

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-21 23:33:07 +01:00
Jing Peng e2c751049c futex.2: tfix
In the comment of the example program, the peer blocks on fwait()
rather than fpost().

Signed-off-by: Jing Peng <pj.hades@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-21 22:25:21 +01:00
Michael Kerrisk 19b2538d4b clock_getres.2: Plae ERRORS in alphabetical order
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-21 06:49:25 +01:00
Michael Kerrisk 6b3561b8e4 arch_prctl.2: wfix: "current thread" ==> "calling thread"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-19 10:20:31 +01:00
Michael Kerrisk 7533c83d88 perf_event_open.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-18 23:39:00 +01:00
Michael Kerrisk 5ae2634dba perf_event_open.2: Minor tweaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-18 23:39:00 +01:00
Namhyung Kim 1e554f3e32 perf_event_open.2: Update man page with recent kernel changes
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
[alx: ffix + tfix]
Cowritten-by:  Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-18 22:58:20 +01:00
Michael Kerrisk a3727934a0 sigaction.2: Add a cross-reference to signal(7) for further info on 'ucontext_t'
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-17 13:18:09 +01:00
Michael Kerrisk ebf47ac9da uselib.2, posix_memalign.3, profil.3, rtime.3: Remove some text about libc/libc5
With this change, there remain almost no vestiges of information
about the long defunct Linux libc.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 12:29:42 +01:00
Michael Kerrisk d678063436 ioctl_tty.2, matherr.3, cciss.4, sk98lin.4: ffix: use proper table for formatting, not .nf/.fi
This gives better PDF rendering.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 11:26:23 +01:00
Michael Kerrisk 30dd9882b0 pidfd_open.2, pidfd_send_signal.2, poll.2, semget.2: ffix: EXAMPLES: use .EX/.EE instead of .nf/.fi
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 11:26:23 +01:00
Michael Kerrisk ce7ba00b76 bpf.2: Place EXAMPLES section in correct location
As per section ordering rules given in man-pages(7).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 08:23:00 +01:00
Michael Kerrisk 71103ce878 prctl.2, setns.2: tfix: remove section number from API documented in this page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 08:22:50 +01:00
Michael Kerrisk 7a92eea0de chroot.2, memfd_create.2, tailq.3: Fix unbalanced .nf/.fi
Reported-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 23:33:33 +01:00
Michael Kerrisk 678f71707e uname.2, feature_test_macros.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 22:30:17 +01:00
Alejandro Colomar d556548bf4 getent.1, fanotify_mark.2, fcntl.2, futex.2, membarrier.2, mmap.2, mount.2, msgctl.2, readv.2, semctl.2, set_mempolicy.2, shmctl.2, syscalls.2, abs.3, bstring.3, btree.3, ctime.3, drand48.3, fgetc.3, fopen.3, gethostbyname.3, getnetent.3, getprotoent.3, getservent.3, INFINITY.3, __ppc_set_ppr_med.3, inet.3, j0.3, makecontext.3, printf.3, puts.3, resolver.3, sigsetops.3, elf.5, nscd.conf.5, proc.5, inotify.7, ipv6.7, spufs.7, system_data_types.7: Use Oxford comma
Found using:
pcregrep -rnM "^\.[B|I]R .*,\n\.[B|I].*[^,]\nand" man? |grep ^man |sort

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 21:30:30 +01:00
Michael Kerrisk 3fd7a10d90 faccessat2.2: New link to access.2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 12:46:29 +01:00
Michael Kerrisk 8729436021 access.2: Document faccessat2()
faccessat2() was added in Linux 5.8 and enables a fix to
longstanding bugs in the faccessat() wrapper function.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 12:44:34 +01:00
Michael Kerrisk 06ad6cdfac access.2: BUGS: note that faccessat() wrapper function emulation ignores ACLs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 12:21:55 +01:00
Colin Ian King 8faba2435b openat.2: Fix include path, should be linux/openat2.h
The include path is linux/openat2, so fix the manual to reference
this correct path.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 10:45:56 +01:00
Michael Kerrisk 3890042031 shmctl.2: wfix (for consistency with other *ctl.2 pages)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 10:27:38 +01:00
Michael Kerrisk 0a33c83e51 msgctl.2, semctl.2, shmctl.2: Minor fix
Break text into more paragraphs to ease readability

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 10:27:33 +01:00
Michael Kerrisk 10aa508cad msgctl.2: Make comments in 'msqid_ds' definition more compact
The comments do not need to be so verbose, since the main text
provides the full details.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 10:06:50 +01:00
Michael Kerrisk bd0ff36407 msgctl.2: Add description of 'msg_cbytes' field
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 10:00:12 +01:00
Michael Kerrisk a07ea11104 msgctl.2: Use field name "msg_cbytes" rather than "__msg_cbytes"
The shorter name is provided by default (i.e., if _DEFAULT_SOURCE
is defined).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 09:56:03 +01:00
Michael Kerrisk 72d2eba770 msgctl.2: Place list of field descriptions in same order as structure definition
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 09:49:49 +01:00
Michael Kerrisk 379c3ee9d0 shmctl.2: Place list of field descriptions in same order as structure definition
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 09:48:15 +01:00
Michael Kerrisk a79c3fc030 semctl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 09:24:11 +01:00
Michael Kerrisk 24ce772b9c sigaction.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-14 10:12:54 +01:00
Michael Kerrisk 57ffe9ddc4 sigaction.2: Minor wording improvements
Restructure the sa_handler description as a list, for easier
reading.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-14 07:56:27 +01:00
Michael Kerrisk 06287aca29 sigaction.2: Clarify description of SA_NODEFER
Clarify description of SA_NODEFER, and note interaction with
act.sa_mask.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-14 07:50:20 +01:00
Michael Kerrisk 66b961cab6 sigaction.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-14 07:50:20 +01:00
Michael Kerrisk 4f71321abe sigaction.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-14 07:50:20 +01:00
Alejandro Colomar 2b9bf369d1 perf_event_open.2: srcfix
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-13 22:49:55 +01:00
Alejandro Colomar 33694c779a io_setup.2: SYNOPSIS: return long
The Linux kernel uses a long as the return type for this syscall.
As glibc provides no wrapper, use the same types the kernel uses.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-13 10:23:53 +01:00
Alejandro Colomar 5020bc2822 perf_event_open.2: Assign calculated value explicitly to 'config'
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-12 21:52:06 +01:00
Michael Kerrisk 3b7d89960a sigaltstack.2: Clarify that the alternate signal stack is per-thread
Clarify that the alternate signal stack is per-thread (rather
than process-wide).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-12 14:32:26 +01:00
Michael Kerrisk 52e5819c41 clone.2, sigaltstack.2: clone(CLONE_VM) disdables the alternate signal stack
In the kernel sources (kernel/fork.c::copy_process()), we have:

        /*
         * sigaltstack should be cleared when sharing the same VM
         */
        if ((clone_flags & (CLONE_VM|CLONE_VFORK)) == CLONE_VM)
                sas_ss_reset(p);

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-12 14:07:17 +01:00
Michael Kerrisk c2a2cc269c sigaction.2: Further clarify the effect of the SA_NODEFER flag
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-12 12:16:45 +01:00
Michael Kerrisk 4be47a8214 getrlimit.2: State more precisely the range of kernel versions that had RLIMIT_LOCKS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-11 13:00:19 +01:00
Michael Kerrisk 0807d1b387 timer_getoverrun.2: timer_getoverrun() now clamps the overrun count to DELAYTIMER_MAX
See https://bugzilla.kernel.org/show_bug.cgi?id=12665.
The fix by Thomas Gleixner was in kernel commit
78c9c4dfbf8c04883941445a195276bb4bb92c76.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-11 10:33:33 +01:00
Michael Kerrisk 9b71be4f0b signal.2: wfix: Make the warning against the use of signal() even more obvious
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-10 13:13:11 +01:00
Michael Kerrisk f100465696 syscalls.2: Note that sysctl() was removed in Linux 5.5
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-06 12:35:47 +01:00
Michael Kerrisk c53d4fc16e bpf.2: Minor wording improvement
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-06 12:34:00 +01:00
Michael Kerrisk baa72cc312 syscalls.2: Add process_madvise()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-06 07:41:02 +01:00
Michael Kerrisk 97ba2b53f5 mount.2, statfs.2: Minor tweaks to Ross Zwisler's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-06 07:40:06 +01:00
Ross Zwisler 527375b2c7 mount.2, statfs.2: Add NOSYMFOLLOW flags to mount(2) and statfs(2)
Signed-off-by: Ross Zwisler <zwisler@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-06 07:40:06 +01:00
Peter Oskolkov d98b1454fc membarrier.2: Update for Linux 5.10
Linux kernel commit 2a36ab717e8fe678d98f81c14a0b124712719840
(part of 5.10 release) changed sys_membarrier prototype/parameters
and added two new commands [MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ
and MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ]. This
man-pages patch reflects these changes, by mostly copying comments
from the kernel patch into the man-page ([Peter Oskolkov] was also
the author of the kernel change).

[mtk: commit message tweaked]

Signed-off-by: Peter Oskolkov <posk@google.com>
Cowritten-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-05 22:07:14 +01:00
Michael Kerrisk 9807d9afdd mmap.2: Clarify SIGBUS text and treatment of partial page at end of a mapping
See https://unix.stackexchange.com/questions/616848/what-is-the-behaviour-of-a-file-backed-memory-map-when-reading-from-or-writing-t

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-02 10:57:14 +01:00
Alejandro Colomar 1d5974814d io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2: SYNOPSIS: s/io_context_t/aio_context_t/
Linux uses aio_context_t for these syscalls,
and it's the type provided by <linux/aio_abi.h>.
Use it in the SYNOPSIS.

libaio uses 'io_context_t', but that difference is already noted
in NOTES.

[mtk: patch slightly tweaked]

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-02 08:46:39 +01:00
Michael Kerrisk 3fde8c2e45 memusage.1, pldd.1, sprof.1, add_key.2, bind.2, bpf.2, clone.2, dup.2, epoll_ctl.2, eventfd.2, fanotify_init.2, fanotify_mark.2, futex.2, getdents.2, getpid.2, getrlimit.2, intro.2, ioctl_fat.2, ioctl_ns.2, kcmp.2, keyctl.2, membarrier.2, memfd_create.2, mprotect.2, msgctl.2, msgop.2, nfsservctl.2, open.2, open_by_handle_at.2, openat2.2, outb.2, perf_event_open.2, pivot_root.2, recv.2, recvmmsg.2, request_key.2, sched_setaffinity.2, sched_setattr.2, seccomp.2, select.2, send.2, signalfd.2, spu_run.2, sysctl.2, timer_create.2, userfaultfd.2, wait.2, CPU_SET.3, abs.3, argz_add.3, backtrace.3, bsearch.3, bswap.3, clock_getcpuclockid.3, cmsg.3, dl_iterate_phdr.3, dlinfo.3, dlopen.3, drand48.3, drand48_r.3, duplocale.3, encrypt.3, endian.3, envz_add.3, errno.3, ffs.3, fopencookie.3, get_phys_pages.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getgrent_r.3, getgrouplist.3, getifaddrs.3, getline.3, getprotoent_r.3, getpwent_r.3, getpwnam.3, getservent_r.3, hsearch.3, insque.3, intro.3, lrint.3, lround.3, lseek64.3, mallinfo.3, malloc_hook.3, malloc_info.3, mbsinit.3, mbstowcs.3, mtrace.3, newlocale.3, ntp_gettime.3, offsetof.3, perror.3, posix_fallocate.3, posix_spawn.3, printf.3, psignal.3, pthread_attr_init.3, pthread_create.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, pthread_setname_np.3, pthread_sigmask.3, qsort.3, rand.3, random.3, rpc.3, rtnetlink.3, scalbln.3, shm_open.3, stdarg.3, strcat.3, strerror.3, strfmon.3, strptime.3, strsignal.3, strtod.3, strtok.3, strtol.3, strtoul.3, tsearch.3, wordexp.3, loop.4, vcs.4, veth.4, core.5, locale.5, slabinfo.5, cgroup_namespaces.7, cpuset.7, credentials.7, fanotify.7, feature_test_macros.7, inotify.7, ip.7, kernel_lockdown.7, man.7, mount_namespaces.7, namespaces.7, pid_namespaces.7, rtld-audit.7, sigevent.7, sock_diag.7, standards.7, unix.7, user_namespaces.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 21:56:08 +01:00
Alejandro Colomar 23a74bd771 openat.2: SYNOPSIS: return long
The Linux kernel uses long as the return type for this syscall.
As glibc provides no wrapper, use the same type the kernel uses.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 19:04:11 +01:00
Alejandro Colomar a024704790 mq_getsetattr.2: Use 'const' when appropriate
The Linux kernel uses the following:

ipc/mqueue.c:1480:
SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes,
		const struct mq_attr __user *, u_mqstat,
		struct mq_attr __user *, u_omqstat)

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 18:23:38 +01:00
Michael Kerrisk 2e33563284 statx.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 07:17:20 +01:00
Alejandro Colomar 68219aba7f futex.2: ffix
That comment wrapped on an 80-column terminal.
Divide it into two lines.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-30 21:05:10 +01:00
Alejandro Colomar 2253ecf016 futex.2: Use appropriate types
The Linux kernel uses the following:

kernel/futex.c:3778:
SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
		struct __kernel_timespec __user *, utime, u32 __user *, uaddr2,
		u32, val3)

Since there is no glibc wrapper, use the same types the kernel uses.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-30 20:16:08 +01:00
Alejandro Colomar 8a60718ef0 futex.2: srcfix
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-30 20:15:59 +01:00
Alejandro Colomar 13e88b7070 getdents.2: Use appropriate types
[mtk: Applied patch manually]

getdents():
This function has no glibc wrapper.
As such, we should use the same types the Linux kernel uses:
Use 'long' as the return type.

getdents64():
The glibc wrapper uses:
ssize_t getdents64(int, void *, size_t);

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-29 20:10:56 +01:00
Michael Kerrisk 833ba57027 getdents.2: Minor tweak to Alex's patch
The text in NOTES doesn't really relate specifically to
the #include, so remove the comment on the #include.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 22:17:53 +01:00
Alejandro Colomar 2adfdd7795 getdents.2: SYNOPSIS: Add missing header and feature test macro
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 22:16:41 +01:00
Alejandro Colomar d70361dab7 getdents.2: wfix
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 22:14:02 +01:00
Alejandro Colomar 276dc9a3cc clock_getres.2: EXAMPLES: Use 'const' when appropriate
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 22:13:50 +01:00
Michael Kerrisk 4111ac7675 perf_event_open.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 17:59:36 +01:00
Michael Kerrisk 0f66701491 perf_event_open.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 17:55:07 +01:00
Alexey Budankov d19b29a5bc perf_event_open.2: Update the man page with CAP_PERFMON related information
Extend this page with the information about CAP_PERFMON capability
designed to secure performance monitoring and observability
operation in a system according to the principle of least
privilege [1] (POSIX IEEE 1003.1e, 2.2.2.39).

[1] https://sites.google.com/site/fullycapable/, posix_1003.1e-990310.pdf

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 17:53:10 +01:00
Michael Kerrisk 1e4d6750e0 clone.2: CAP_CHECKPOINT_RESTORE can now be used to employ 'set_tid'
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Michael Kerrisk 11fd5e7c2a membarrier.2, openat2.2, insque.3, proc.5, tzfile.5, hier.7: Minor grammar fix
Don't hyphenate after adjective ending in "ly". See, for example:
https://www.dragoman.ist/compound-modifiers-with-words-ending-in-ly/
https://www.merriam-webster.com/words-at-play/6-common-hypercorrections-and-how-to-avoid-them/between-you-and-i

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 13:12:57 +01:00
Alejandro Colomar 6280809fb8 openat2.2, loop.4: tfix: s/non-zero/nonzero/
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-22 23:06:02 +02:00
Michael Kerrisk 2009b72758 setns.2: Correct the version for time namespace support
Time namespaces were added in kernel 5.6, but setns() support
for time namespaces was added only starting with kernel 5.8:

    commit 76c12881a38aaa83e1eb4ce2fada36c3a732bad4
    Author: Christian Brauner <christian.brauner@ubuntu.com>
    Date:   Mon Jul 6 17:49:11 2020 +0200

        nsproxy: support CLONE_NEWTIME with setns()

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-20 12:54:32 +02:00
Michael Kerrisk 02667b1ee5 link.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-16 08:47:15 +02:00
Michael Kerrisk 4b6e3782e1 seccomp.2: Warn reader that SECCOMP_RET_TRACE can be overridden
Highlight to the reader that if another filter returns a
higher-precedence action value, then the ptracer will not
be notified.

Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-15 13:06:36 +02:00
Michael Kerrisk 5d771a4a9d futex.2, quotactl.2: wfix: use "bitwise" rather than "bit-wise"
Most manual pages already use "bitwise".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-14 18:34:45 +02:00
Michael Kerrisk 2c1b51b14b epoll_ctl.2: epoll instances can be nested to a maximum depth of 5
This limit appears to be an off-by-one count against
EP_MAX_NESTS (4).

Verified by experiment.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-09 23:49:54 +02:00
Michael Kerrisk be1586b2f6 epoll_ctl.2: Move some version info from CONFORMING TO to VERSIONS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-09 23:06:43 +02:00
Michael Kerrisk 2650e82753 recv.2, send.2: Add cross references to pages with further info about ancillary data
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-08 07:42:24 +02:00
Michael Kerrisk 0f849717a9 send.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-08 07:00:11 +02:00
Samanta Navarro 9d4976ce7d mmap.2, proc.5, bpf-helpers.7, cpuset.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-07 19:24:59 +02:00
Aleksa Sarai bbed82c069 openat2.2: tfix: fix minor reference typo
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-30 21:45:57 +02:00
Aleksa Sarai 1953608d8a sched_getattr.2: Update to include changed size semantics
Due to a userspace breakage, commit 1251201c0d34 ("sched/core: Fix
uclamp ABI bug, clean up and robustify sched_read_attr() ABI logic
and code") changed the semantics of sched_getattr(2) when the
userspace struct is smaller than the kernel struct. Now, any
trailing non-zero data in the kernel structure is ignored when
copying to userspace. We also document the original error code
correctly (it was EFBIG not E2BIG) in the BUGS section.

Ref: 1251201c0d34 ("sched/core: Fix uclamp ABI bug, clean up and
                 robustify sched_read_attr() ABI logic and code")

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-30 21:45:23 +02:00
Michael Kerrisk c089afee8b perf_event_open.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 16:41:26 +02:00
Michael Kerrisk 3cf6149060 adjtimex.2, futex.2, semop.2, slabinfo.5, feature_test_macros.7, keyrings.7: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 16:34:29 +02:00
Michael Kerrisk d39ad78f73 _exit.2, access.2, acct.2, brk.2, chdir.2, chmod.2, chown.2, chroot.2, clock_getres.2, clock_nanosleep.2, fsync.2, futimesat.2, getdomainname.2, getgroups.2, gethostname.2, getpagesize.2, getrlimit.2, getsid.2, gettimeofday.2, kill.2, link.2, madvise.2, mincore.2, mkdir.2, mknod.2, nanosleep.2, nice.2, open.2, posix_fadvise.2, pread.2, process_vm_readv.2, readlink.2, readv.2, rename.2, select.2, semop.2, seteuid.2, setpgid.2, setreuid.2, sigaction.2, sigaltstack.2, sigpending.2, sigprocmask.2, sigsuspend.2, sigwaitinfo.2, stat.2, stime.2, symlink.2, sync.2, syscall.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, truncate.2, unlink.2, utimensat.2, vfork.2, vhangup.2, wait.2, wait4.2, a64l.3, abs.3, acos.3, acosh.3, addseverity.3, adjtime.3, asin.3, asinh.3, atan.3, atan2.3, atanh.3, atoi.3, bsd_signal.3, cbrt.3, ceil.3, cfree.3, clearenv.3, clock_getcpuclockid.3, confstr.3, copysign.3, cos.3, cosh.3, ctermid.3, ctime.3, daemon.3, dirfd.3, div.3, drand48.3, drand48_r.3, duplocale.3, dysize.3, ecvt.3, ecvt_r.3, endian.3, erf.3, erfc.3, exec.3, exp.3, exp2.3, expm1.3, fabs.3, fdim.3, ferror.3, fexecve.3, ffs.3, fgetgrent.3, fgetpwent.3, finite.3, flockfile.3, floor.3, fma.3, fmax.3, fmemopen.3, fmin.3, fmod.3, fopen.3, fpclassify.3, frexp.3, fseeko.3, ftw.3, futimes.3, fwide.3, gamma.3, gcvt.3, getaddrinfo.3, getcwd.3, getdate.3, getdirentries.3, getdtablesize.3, getentropy.3, getenv.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getline.3, getloadavg.3, getlogin.3, getmntent.3, getnameinfo.3, getnetent_r.3, getopt.3, getpass.3, getprotoent_r.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent_r.3, getservent_r.3, getspnam.3, getsubopt.3, getusershell.3, getw.3, grantpt.3, group_member.3, gsignal.3, hypot.3, ilogb.3, inet.3, inet_net_pton.3, initgroups.3, insque.3, isalpha.3, isfdtype.3, isgreater.3, iswblank.3, j0.3, killpg.3, ldexp.3, lgamma.3, lockf.3, log.3, log10.3, log1p.3, log2.3, logb.3, lrint.3, lround.3, malloc.3, mbsnrtowcs.3, memchr.3, mkdtemp.3, mkfifo.3, mkstemp.3, mktemp.3, modf.3, mq_receive.3, mq_send.3, nan.3, newlocale.3, nextafter.3, nl_langinfo.3, on_exit.3, open_memstream.3, opendir.3, perror.3, popen.3, posix_fallocate.3, posix_madvise.3, posix_memalign.3, posix_openpt.3, pow.3, printf.3, profil.3, psignal.3, pthread_attr_setstack.3, pthread_cleanup_push_defer_np.3, pthread_kill.3, pthread_mutex_consistent.3, pthread_mutexattr_setrobust.3, pthread_rwlockattr_setkind_np.3, pthread_sigmask.3, pthread_sigqueue.3, pthread_spin_init.3, pthread_spin_lock.3, ptsname.3, putenv.3, putpwent.3, qecvt.3, qsort.3, rand.3, random.3, random_r.3, rcmd.3, readdir_r.3, realpath.3, remainder.3, remquo.3, rint.3, round.3, rpmatch.3, scalb.3, scalbln.3, scandir.3, scanf.3, sched_getcpu.3, seekdir.3, sem_wait.3, setbuf.3, setenv.3, setjmp.3, setnetgrent.3, siginterrupt.3, signbit.3, significand.3, sigqueue.3, sigset.3, sigsetops.3, sigvec.3, sigwait.3, sin.3, sinh.3, sockatmark.3, sqrt.3, stpcpy.3, stpncpy.3, strdup.3, strerror.3, strfromd.3, strnlen.3, strsep.3, strsignal.3, strtod.3, strtok.3, strtol.3, strtoul.3, syslog.3, tan.3, tanh.3, telldir.3, tempnam.3, termios.3, tgamma.3, timegm.3, timeradd.3, tmpnam.3, toascii.3, toupper.3, towlower.3, towupper.3, trunc.3, ttyslot.3, tzset.3, ualarm.3, unlocked_stdio.3, unlockpt.3, uselocale.3, usleep.3, wcpcpy.3, wcpncpy.3, wcscasecmp.3, wcsdup.3, wcsncasecmp.3, wcsnlen.3, wcsnrtombs.3, wordexp.3, wprintf.3, y0.3: srcfix: use better macros in SYNOPSIS
Around the text:
"Feature Test Macro Requirements for glibc..."
replace ".in -4n/.in" with ".RS -4/.RE".
The latter form is more idiomatic use of man macros.
The nroff output is unchanged.

Reported-by: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 15:12:12 +02:00
Michael Kerrisk 281dca499e chmod.2, connect.2, recv.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 14:46:56 +02:00
Michael Kerrisk 161b8eda4d clone.2, io_submit.2, select.2, shmget.2, getcontext.3, malloc_info.3, mtrace.3, posix_spawn.3, strfromd.3, proc.5: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 14:24:12 +02:00
Michael Kerrisk c9e6c5abc9 statx.2: Minor edits to Ira Weiny's
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 10:27:10 +02:00
Ira Weiny 38ad6a8808 statx.2: Add STATX_ATTR_DAX
Linux 5.8 adds STATX_ATTR_DAX support.

https://lore.kernel.org/lkml/20200428002142.404144-4-ira.weiny@intel.com/
https://lore.kernel.org/lkml/20200504161352.GA13783@magnolia/

Add the text to the statx man page.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 10:21:21 +02:00
Michael Kerrisk e9a0682b18 ioctl_fslabel.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-28 12:40:13 +02:00
Michael Kerrisk 9076359f0e seccomp.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-26 15:49:32 +02:00
Alejandro Colomar 59a1988b25 seccomp.2: Use ARRAY_SIZE() macro instead of raw sizeof division
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-25 11:25:12 +02:00
Alejandro Colomar c9cedb53b2 seccomp.2: Remove unneeded cast
From the email discussion:

> Hi Alex,
>
> On 9/25/20 9:31 AM, Alejandro Colomar wrote:
>> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
>> ---
>>   man2/seccomp.2 | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/man2/seccomp.2 b/man2/seccomp.2
>> index 58033da1c..d6b856c32 100644
>> --- a/man2/seccomp.2
>> +++ b/man2/seccomp.2
>> @@ -1101,7 +1101,7 @@ install_filter(int syscall_nr, int t_arch, int f_errno)
>>       };
>>
>>       struct sock_fprog prog = {
>> -        .len = (unsigned short) (sizeof(filter) / sizeof(filter[0])),
>> +        .len = sizeof(filter) / sizeof(filter[0]),
>>           .filter = filter,
>>       };
>
> I have a small doubt about this change. With the change,
> there are no compilation warnings.
>
> But, if we change the code to something slightly different:
>
> [[
>      size_t x = (sizeof(filter) / sizeof(filter[0]));
>      struct sock_fprog prog = {
>          .len = x,
>          .filter = filter,
>      };
> ]]
>
> The "cc -Wconversion" gives us the following warning:
>
>      warning: conversion from ‘size_t’ {aka ‘long unsigned int’}
>      to ‘short unsigned int’ may change value
>
> Presumably we don't get a warning for an assignment of the form
>
>      .len = (sizeof(filter) / sizeof(filter[0]))
>
> because the compiler is smart enough to work out that the
> value of the constant expression is within the range of
> "unsigned short".
>
> Your thoughts?

Hi Michael,

I'd say that the cast doesn't fix any problems at all.  It silences a
valid warning, and I'd use a pragma for that (to be more explicit about
the intention of silencing a warning) if I do want -Wconversion enabled
(which usually I don't want, because it's too noisy) and I'm sure that
this won't overflow.  I'd limit the use casts to only when I *really*
need to.

I guess that if you enable -O3, the warning will vanish again because
the compiler will optimize away 'x' (but I didn't test).

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-25 11:17:01 +02:00
Michael Kerrisk 9f5f1b5b8f ptrace.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 09:47:55 +02:00
Michael Kerrisk 861d36ba31 pldd.1, bpf.2, clone.2, dup.2, ioctl_fat.2, nfsservctl.2, open_by_handle_at.2, perf_event_open.2, pivot_root.2, request_key.2, sched_setaffinity.2, seccomp.2, select.2, statx.2, dl_iterate_phdr.3, dlinfo.3, dlopen.3, insque.3, newlocale.3, printf.3, pthread_setname_np.3, rpc.3, stdarg.3, strfmon.3, veth.4, proc.5, slabinfo.5, cgroup_namespaces.7, cgroups.7, cpuset.7, fanotify.7, inotify.7, mount_namespaces.7, sock_diag.7, user_namespaces.7, ld.so.8: Use \(aq instead of ' inside monospace fonts
Use \(aq to get an unslanted single quote inside monospace code
blocks. Using a simple ' results in a slanted quote inside PDFs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 09:32:31 +02:00
Michael Kerrisk 89de1a399e open.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 09:02:29 +02:00
Alejandro Colomar a39e673a89 ioctl_ns.2, stat.2: Fix signedness of printf specifiers
These variables are either of an unsigned integer type per POSIX;
or of an integer type per POSIX, that Linux defines as an unsigned integer type.

Print them with 'uintmax_t' instead of 'intmax_t' to avoid
big positive numbers being printed as negative numbers.

Bug report:
From: Konstantin Bukin @ 2020-09-13 15:04 UTC
  To: mtk.manpages; +Cc: Konstantin Bukin, linux-man

inode numbers are expected to be positive. Casting them to a signed type
may result in printing negative values. E.g. running example program on
the following file:

$ ls -li test.txt
9280843260537405888 -r--r--r-- 1 kbukin hardware 300 Jul 21 06:36 test.txt

results in the following output:

$ ./example test.txt
ID of containing device:  [0,480]
File type:                regular file
I-node number:            -9165900813172145728
Mode:                     100444 (octal)
Link count:               1
Ownership:                UID=2743   GID=30
Preferred I/O block size: 32768 bytes
File size:                300 bytes
Blocks allocated:         8
Last status change:       Tue Jul 21 06:36:50 2020
Last file access:         Sat Sep 12 14:13:38 2020
Last file modification:   Tue Jul 21 06:36:50 2020

Such erroneous reporting happens for inode values greater than maximum
value which can be stored in signed long. Casting does not seem to be
necessary here. Printing inode as unsigned long fixes the issue.

Reported-by: Konstantin Bukin <kbukin@gmail.com>
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 00:02:13 +02:00
Michael Kerrisk 95c3d0a025 kcmp.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-22 10:08:14 +02:00
Michael Kerrisk 14dd128c7c syscalls.2: Move system calls from discontinued ports out of main syscall list
Various ports that had their own indigenous system calls have
been discontinued. Remove those system calls (none of which had
manual pages!) to a separate part of the page, to avoid
cluttering the main list of system calls.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-20 14:20:39 +02:00
Michael Kerrisk d022c7fdf0 getcwd.2, mq_notify.2, mq_open.2, mq_timedreceive.2, mq_timedsend.2, mq_unlink.2: Reinstate links to section 3 pages that document system calls
Some of the links removed in commit 247c654385 should
have been kept, because in some cases there are real system
calls whose wrapper functions are documented in Section 3.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-20 13:41:38 +02:00
Michael Kerrisk 0a3bfcf774 syscalls.2: Remove duplicate entry for swapcontext(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-20 13:21:46 +02:00
Michael Kerrisk 9f2a6007d1 intro.2, intro.3, feature_test_macros.7, standards.7: SEE ALSO: add system_data_types(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-17 22:54:01 +02:00
Michael Kerrisk 966d17b1c5 sigaction.2: Use correct POSIX type for siginfo_t.si_value
Reported-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-16 16:26:12 +02:00
Alejandro Colomar 8eb90116f1 add_key.2, clock_getres.2, clone.2, futex.2, getdents.2, getpid.2, getrlimit.2, ioctl_ns.2, kcmp.2, keyctl.2, memfd_create.2, request_key.2, stat.2, timer_create.2, wait.2, clock_getcpuclockid.3, dl_iterate_phdr.3, getgrent_r.3, getpwent_r.3, getpwnam.3, posix_spawn.3, pthread_getcpuclockid.3, strcat.3, feature_test_macros.7, user_namespaces.7: Switch printf() casts to use [u]intmax_t + %ju / %jd
Let's move to the 21st century. Instead of casting system data
types to long/long long/etc. in printf() calls, instead cast to
intmax_t or uintmax_t, the largest available signed/unsigned
integer types.

[mtk: rewrote commit message]

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-15 07:39:19 +02:00
Alejandro Colomar 6fd153d540 clock_getres.2: Cast 'time_t' to 'int' for printf() and fix the length modifiers
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Reviewed-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-13 08:07:05 +02:00
Alejandro Colomar f6fbffeae5 userfaultfd.2: Use 'PRIx64' rather than "%llx" when printing 64-bit fixed-width types
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-13 08:07:05 +02:00
Alejandro Colomar 1bdfc7fc42 open_by_handle_at.2: Use "%u" rather than "%d" when printing 'unsigned int' values
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-13 08:07:05 +02:00
Alejandro Colomar 982dfed192 mprotect.2: Use "%p" rather than casting to 'long' when printing pointer values
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-13 08:06:46 +02:00
Alejandro Colomar dc97703b4a eventfd.2, mprotect.2, pidfd_open.2, spu_run.2, timer_create.2, bswap.3, dl_iterate_phdr.3, endian.3, pthread_attr_init.3, pthread_getattr_np.3, vcs.4, rtld-audit.7: In printf(): s/0x%/%#/ except when followed by X instead of x
Use printf()'s '#' flag character to prepend the string "0x".

However, when the number is printed in uppercase, and the prefix
is in lowercase, the string "0x" needs to be manually written.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-12 08:38:20 +02:00
Alejandro Colomar ae85f653e4 msgctl.2, outb.2, abs.3, dl_iterate_phdr.3, drand48.3, drand48_r.3, encrypt.3, ffs.3, lrint.3, lround.3, ntp_gettime.3, printf.3, random.3, scalbln.3, scanf.3, strtol.3, strtoul.3, utmp.5, feature_test_macros.7, rtld-audit.7: Omit 'int' keyword for 'short', 'long' and 'long long' types, both signed and 'unsigned'
For consistency.

The types are written both with and without the redundant 'int' keyword
all over the man-pages.  However, the most used form, by far, is the one
without 'int'.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-12 08:37:41 +02:00
Michael Kerrisk 68041421a1 userfaultfd.2: Use a better type (uint64_t) for 'len' in EXAMPLES
See the previous commit to bswap.3...

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 14:19:24 +02:00
Alejandro Colomar ea7dc0bdcf stat.2: wsfix
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 11:36:05 +02:00
Michael Kerrisk fbd150d909 timerfd_create.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 11:33:28 +02:00
Alejandro Colomar 76db89d368 stat.2: Cast to 'unsigned long' rather than 'long' when printing with "%lx"
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 11:33:28 +02:00
Alejandro Colomar e080a90f48 ioctl_ns.2: Cast to 'unsigned long' rather than 'long' when printing with "%lx"
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 11:33:28 +02:00
Alejandro Colomar 77de385db6 eventfd.2: Use 'PRIxN' macros when printing C99 fixed-width integer types
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 11:33:28 +02:00
Alejandro Colomar 86d90299ae timerfd_create.2: Use 'PRIxN' macros when printing C99 fixed-width integer types
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 11:33:28 +02:00
Alejandro Colomar 3996bc9c26 timer_create.2: Cast to 'unsigned long' rather than 'long' when printing with "%lx"
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 11:33:20 +02:00
Alejandro Colomar c9e2544b17 request_key.2: Cast to 'unsigned long' rather than 'long' when printing with "%lx"
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 09:51:12 +02:00
Alejandro Colomar 53de137678 add_key.2: Cast to 'unsigned long' rather than 'long' when printing with "%lx"
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 09:50:32 +02:00
Alejandro Colomar 6da4ee9147 membarrier.2: Note that glibc does not provide a wrapper
Notes: I copied .nf and .fi from futex.2, but they made no visual difference.
What do they actually do?

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 08:44:48 +02:00
Michael Kerrisk 10c2b377e5 readlink.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 07:33:34 +02:00
Michael Kerrisk c97d0132a0 spu_create.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 07:20:48 +02:00
Michael Kerrisk 712d2fa586 copy_file_range.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 07:19:38 +02:00
Michael Kerrisk 4190ca0ab3 ioctl_userfaultfd.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-11 07:19:04 +02:00
Michael Kerrisk e38283d738 msgop.2: Minor tweak's to Yang Xu's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-09 14:23:57 +02:00
Yang Xu ab365f43e7 msgop.2: Add restriction on ENOSYS error
When calling msgrcv() with the MSG_COPY flag, it will report
EINVAL error even we if have disabled CONFIG_CHECKPOINT_RESTORE.
ENOSYS will be reported only if we also specify the IPC_NOWAIT
flag.

[mtk: edited commit message]

Notes from mtk:

The relevant kernel code is this:

[[
#ifdef CONFIG_CHECKPOINT_RESTORE
...
#else
static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz)
{
        return ERR_PTR(-ENOSYS);
}

...
static long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long
msgtyp, int msgflg,
               long (*msg_handler)(void __user *, struct msg_msg *, size_t))
{
...
        if (msgflg & MSG_COPY) {
                if ((msgflg & MSG_EXCEPT) || !(msgflg & IPC_NOWAIT))
                        return -EINVAL;
                copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax));
...
}
]]

We'll only hit the ENOSYS error if:
(1) MSG_COPY was specified;
(2) IPC_NOWAIT was not specified; and
(3) CONFIG_CHECKPOINT_RESTORE was not enabled.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-09 14:19:44 +02:00
Michael Kerrisk 836a5bbf02 open.2: ERRORS: EBUSY
An EBUSY error case is mentioned in DESCRIPTIOn; add it to ERRORS
also.

See also https://bugzilla.kernel.org/show_bug.cgi?id=209109

Reported-by: henrik@optoscale.no
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-07 09:26:02 +02:00
Alejandro Colomar 180698be28 msgop.2: Remove unneeded casts
The type `struct msgbuf *` is implicitly casted to `const void *`.
Not only that, but the explicit cast to `void *` was slightly
misleading.
Explicitly casting can silence warnings when mistakes are made, so it's
better to remove those casts when possible.

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-06 14:57:59 +02:00
Michael Kerrisk 88893a773c sprof.1, eventfd.2, execve.2, futex.2, getdents.2, mprotect.2, open_by_handle_at.2, recvmmsg.2, sched_setaffinity.2, CPU_SET.3, backtrace.3, bsearch.3, dl_iterate_phdr.3, dlinfo.3, duplocale.3, encrypt.3, envz_add.3, fopencookie.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getgrent_r.3, getgrouplist.3, getifaddrs.3, getprotoent_r.3, getservent_r.3, hsearch.3, mallinfo.3, malloc_info.3, mbstowcs.3, mtrace.3, pthread_create.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, qsort.3, rand.3, strcat.3, strtok.3, tsearch.3, wordexp.3, core.5, aio.7, inotify.7, sock_diag.7, unix.7, user_namespaces.7: Use C99 style to declare loop counter variables
Rather than:

    sometype x;

    for (x = ....; ...)

use

    for (sometype x = ...; ...)

This brings the declaration and use closer together (thus aiding
readability) and also clearly indicates the scope of the loop
counter variable.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05 17:20:12 +02:00
Michael Kerrisk 3b27ce1573 getdents.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05 16:54:19 +02:00
Alejandro Colomar b300d5cf92 signalfd.2: Use sizeof consistently
Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

	Rationale:
	https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05 14:49:42 +02:00
Alejandro Colomar bbedcb755a sysctl.2: Use sizeof consistently
Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

	Rationale:
	https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05 14:49:42 +02:00
Alejandro Colomar 284a36798f perf_event_open.2: Use sizeof consistently
Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

	Rationale:
	https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05 14:49:42 +02:00
Alejandro Colomar 3376a63838 perf_event_open.2: Use sizeof consistently
Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

	Rationale:
	https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05 14:49:42 +02:00
Alejandro Colomar aff660d379 open_by_handle_at.2: Use sizeof consistently
Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

	Rationale:
	https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05 14:49:42 +02:00
Alejandro Colomar d60a7a9a4b futex.2: Use sizeof consistently
Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

	Rationale:
	https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05 14:49:42 +02:00
Alejandro Colomar b40e812a64 bind.2: Use sizeof consistently
Use ``sizeof`` consistently through all the examples in the following
way:

- Use the name of the variable instead of its type as argument for
  ``sizeof``.

	Rationale:
	https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05 14:49:42 +02:00
Michael Kerrisk 78da9b6b29 bind.2, ioctl_ns.2, open_by_handle_at.2, duplocale.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-05 14:49:42 +02:00
Michael Kerrisk 0bda7dedcf fanotify_init.2, fanotify.7: Minor edits to Amir Goldstein's patches
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 14:26:12 +02:00
Michael Kerrisk 1a1e4638a5 fanotify_init.2, fanotify.7: srcfix: Semantic newlines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 14:18:05 +02:00
Amir Goldstein ea4f577808 fanotify.7, fanotify_init.2: Document FAN_REPORT_NAME
Document fanotify_init(2) flag FAN_REPORT_NAME and the format of
the event info type FAN_EVENT_INFO_TYPE_DFID_NAME.

The fanotify_fid.c example is extended to also report the name of
the created file or subdirectory.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 14:16:30 +02:00
Amir Goldstein e9f14fa0bb fanotify.7, fanotify_init.2: Document FAN_REPORT_DIR_FID
Document fanotify_init(2) flag FAN_REPORT_DIR_FID and event info
type FAN_EVENT_INFO_TYPE_DFID.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 14:16:03 +02:00
Amir Goldstein b216da617f fanotify.7, fanotify_mark.2: Generalize documentation of FAN_REPORT_FID
With fanotify_init(2) flag FAN_REPORT_FID, the group identifies
filesystem objects by file handles in a single event info record
of type FAN_EVENT_INFO_TYPE_FID.

We intend to add support for new fanotify_init(2) flags for which
the group identifies filesystem objects by file handles and add
more event info record types.

To that end, start by changing the language of the man page to
refer to a "group that identifies filesystem objects by file
handles" instead of referring to the FAN_REPORT_FID flag and
document the extended event format structure in a more generic
manner that allows more than a single event info record and not
only a record of type FAN_EVENT_INFO_TYPE_FID.

Clarify that the object identified by the file handle refers to
the directory in directory entry modification events.

Remove a note about directory entry modification events and
monitoring a mount point that I found to be too confusing and out
of context.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 14:15:31 +02:00
Michael Kerrisk e7497fba60 mount.2: Minor wording improvement
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 13:51:17 +02:00
Michael Kerrisk 6a955f035e syscalls.2: Bump kernel version number
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-28 11:35:12 +02:00
Michael Kerrisk 373bd6e2bb syscalls.2: Add close_range (Linux 5.9)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-27 17:19:43 +02:00
Michael Kerrisk fb84ed2aae clock_getres.2: Fix type and variable name in dynamic clock code example
Use 'struct timespec', not 'struct timeval', and adjust
the variable name accordingly.

Reported-by: Tony May <tony.may@mediakind.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-26 08:10:56 +02:00
Michael Kerrisk f15ff6fa4e seccomp.2: EXAMPLES: use SECCOMP_RET_KILL_PROCESS rather than SECCOMP_RET_KILL
See previous commit.

Reported-by: Rich Felker <dalias@libc.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-23 19:23:46 +02:00
Michael Kerrisk 6b0c25f101 seccomp.2: Warn against the use of SECCOMP_RET_KILL_THREAD
Killing a thread with SECCOMP_RET_KILL_THREAD is very likely
to leave the rest of the process in a broken state.

Wording pretty much taken from Rick Felker's suggestion.

Reported-by: Rich Felker <dalias@libc.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-23 19:23:46 +02:00
Michael Kerrisk ed6c69cab9 intro.1, clock_getres.2, execve.2, fcntl.2, iopl.2, lseek.2, mknod.2, mmap.2, mount.2, mq_getsetattr.2, pidfd_open.2, prctl.2, setns.2, sgetmask.2, sigaction.2, stat.2, statx.2, sync.2, syscalls.2, syslog.2, timerfd_create.2, umask.2, a64l.3, aio_init.3, atoi.3, dladdr.3, fread.3, getpt.3, isfdtype.3, malloc_stats.3, malloc_trim.3, mkfifo.3, mq_close.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, posix_memalign.3, posix_openpt.3, pthread_atfork.3, pthread_rwlockattr_setkind_np.3, regex.3, scanf.3, sem_close.3, sem_destroy.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sigset.3, sigvec.3, strftime.3, termios.3, console_codes.4, dsp56k.4, fd.4, lp.4, mouse.4, pts.4, sk98lin.4, dir_colors.5, proc.5, resolv.conf.5, termcap.5, utmp.5, aio.7, armscii-8.7, arp.7, capabilities.7, cgroups.7, charsets.7, cp1251.7, cp1252.7, environ.7, glob.7, inode.7, iso_8859-1.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-16.7, iso_8859-2.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-8.7, iso_8859-9.7, keyrings.7, koi8-r.7, koi8-u.7, mailaddr.7, man-pages.7, netdevice.7, operator.7, persistent-keyring.7, process-keyring.7, pthreads.7, pty.7, raw.7, regex.7, session-keyring.7, shm_overview.7, signal.7, socket.7, suffixes.7, thread-keyring.7, unicode.7, units.7, uri.7, user-keyring.7, user-session-keyring.7, iconvconfig.8, ld.so.8, zic.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-13 10:01:14 +02:00
Michael Kerrisk 9ca13180d5 pldd.1, bpf.2, execve.2, futex.2, ioctl_fat.2, ioctl_tty.2, keyctl.2, signalfd.2, timerfd_create.2, __ppc_get_timebase.3, a64l.3, frexp.3, pthread_setname_np.3, regex.3, rpmatch.3, scanf.3, strfmon.3, strftime.3, termios.3, console_codes.4, vcs.4, veth.4, core.5, dir_colors.5, termcap.5, ascii.7, charsets.7, glob.7, man-pages.7, operator.7, regex.7, user_namespaces.7, zic.8: Use "\(ha" rather than "^" in code
This renders better in PDF.

Reported-by: Geoff Clare <gwc@opengroup.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-09 10:22:22 +02:00
Michael Kerrisk af2d18b2c2 intro.1, clock_getres.2, clone.2, futex.2, ioctl_fat.2, mkdir.2, mknod.2, mmap.2, open.2, statx.2, umask.2, userfaultfd.2, glob.3, mkfifo.3, termios.3, wordexp.3, console_codes.4, sk98lin.4, vcs.4, dir_colors.5, hosts.equiv.5, proc.5, termcap.5, utmp.5, ascii.7, bpf-helpers.7, charsets.7, environ.7, glob.7, mailaddr.7, netlink.7, operator.7, suffixes.7, tcp.7, unicode.7, uri.7, zic.8: Use "\(ti" instead of "~"
A naked tilde ("~") renders poorly in PDF. Instead use "\(ti",
which renders better in a PDF, and produces the same glyph
when rendering on a terminal.

Reported-by: Geoff Clare <gwc@opengroup.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-06 22:25:11 +02:00
Michael Kerrisk 0629df8b96 open.2, proc.5: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-31 22:32:59 +02:00
Michael Kerrisk 8842f53458 ioctl_tty.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-30 12:11:21 +02:00
Michael Kerrisk 322522ea3b ioctl_tty.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-30 12:06:11 +02:00
Michael Kerrisk 490f9b6c2b socket.2, address_families.7: wfix: multiplexor ==> multiplexer
Both are used, but "multiplexer" seems to be majority usage in
English.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-30 08:03:02 +02:00
Michael Kerrisk cc1a0b7e16 ioctl_tty.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29 11:17:08 +02:00
Michael Kerrisk c4316bb5f6 ioctl_tty.2: Minor wording and formatting fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29 11:17:08 +02:00
Michael Kerrisk 7b67208034 ioctl_tty.2: Fix a confusing wording error in description of TIOCSPTLCK
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-29 08:56:21 +02:00
Mike Frysinger 795cf36094 Various pages: Drop t comment header
Historically, a comment of the following form at the top of a
manual page was used to indicate too man(1) that the use of tbl(1)
was required in order to process tables:

    '\" t

However, at least as far back as 2001 (according to Branden),
man-db's man(1) automatically uses tbl(1) as needed, rendering
this comment unnecessary. And indeed many existing pages in
man-pages that have tables don't have this comment at the top of
the file.  So, drop the comment from those files where it is
present.

[mtk: completely rewrote commit message]

Reported-by: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24 14:18:27 +02:00
Michael Kerrisk de527cb9b7 seccomp.2: Minor tweaks to Andy Lutomirski's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24 14:15:00 +02:00
Andy Lutomirski 9729408da5 seccomp.2: Improve x32 and nr truncation notes
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24 13:53:22 +02:00
Michael Kerrisk 901c8ecf7c open.2: Say a bit more about what happens when 'mode' is wrongly omitted
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24 13:26:38 +02:00
Michael Kerrisk 88f463a9be open.2: Minor wording fixes
Add some paragraph breaks to the discussion of 'mode' to make
the details a bit easier to read.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24 13:16:16 +02:00
Michael Kerrisk 7f4e971631 open.2: srcfix: use saner macros to achieve same formatting effect
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24 13:14:41 +02:00
Mike Frysinger 243d656fdb Various pages: Use standard .\" comment style
The \" comment produces blank lines.  Use the .\" that the vast
majority of the codebase uses instead.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-24 12:55:55 +02:00
Michael Kerrisk 3c650501b3 ioctl_fat.2, dladdr.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-20 13:47:59 +02:00
Jakub Wilk cc6d2edb9b prctl.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-20 11:26:40 +02:00
Andrew Price a5b25af5c5 lseek.2: List gfs2 support for SEEK_HOLE/SEEK_DATA
Signed-off-by: Andrew Price <anprice@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-17 13:31:12 +02:00
Michael Kerrisk 298743a573 setns.2: EXAMPLE: use O_CLOEXEC when opening namespace file descriptor
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-17 09:22:52 +02:00
Michael Kerrisk 7cb61821b9 pidfd_open.2: Close the pidfd in EXAMPLE
Close the PID file descriptor in the example program, to hint to
the reader that like every other kind of file descriptor, a PID FD
should be closed.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-17 09:13:31 +02:00
Michael Kerrisk f4fb9919e1 truncate.2: tfix
Reported-by: Diogo Miguel Ferreira Rodrigues <dmfrodrigues2000@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-13 09:17:58 +02:00
Michael Kerrisk 402f2e7b67 prctl.2: The parent death signal is cleared on some credential changes
See kernel/cred.c::commit_creds() in the Linux 5.6 source code.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-11 11:40:24 +02:00
Michael Kerrisk 28a4c58cc2 intro.1, localedef.1, memusage.1, memusagestat.1, bpf.2, execve.2, fork.2, keyctl.2, request_key.2, sigaction.2, signal.2, socket.2, dlopen.3, getauxval.3, gnu_get_libc_version.3, pthread_atfork.3, sem_post.3, setjmp.3, strftime.3, veth.4, locale.5, nscd.conf.5, resolv.conf.5, address_families.7, armscii-8.7, ascii.7, capabilities.7, cgroups.7, charsets.7, cp1251.7, cp1252.7, iso_8859-1.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-16.7, iso_8859-2.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-8.7, iso_8859-9.7, keyrings.7, koi8-r.7, koi8-u.7, libc.7, locale.7, man.7, network_namespaces.7, persistent-keyring.7, session-keyring.7, signal.7, unicode.7, uri.7, user-keyring.7, user-session-keyring.7: ffix: replace - with real\-
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06 14:28:51 +02:00
Michael Kerrisk 168aac07bd move_pages.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06 13:57:58 +02:00
Jakub Wilk 6a17c54c3a prctl.2: tfix
Remove duplicated word.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06 13:39:15 +02:00
Michael Kerrisk 019390e04d shmop.2: tfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06 12:53:39 +02:00
Michael Kerrisk 313fb52719 open.2: tfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06 12:42:33 +02:00
Michael Kerrisk 234d7f094d mremap.2: tfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06 12:41:25 +02:00
Michael Kerrisk 0664253bf8 mmap.2: wfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06 12:39:09 +02:00
Michael Kerrisk 9e9a5b61b5 execve.2: tfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06 12:35:57 +02:00
Alyssa Ross 71d8892776 send.2, recv.2: Add msg_iovlen POSIX note
msg_iovlen is incorrectly typed (according to POSIX) in addition
to msg_controllen, but unlike msg_controllen, this wasn't
mentioned for msg_iovlen.

msg_iovlen being incorrectly typed hasn't been reported as a GCC
bug, but there's no point since it is caused by the same
underlying issue.

Sources: POSIX.1-2017 (<sys/socket.h>), Linux
(include/linux/socket.h)

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-03 13:42:22 +02:00
Michael Kerrisk 16170fbc5c mount.2: ERRORS: add EINVAL for bind mount of mount namespace inode
See kernel commit 8823c079ba7136dc1948d6f6dcb5f8022bde438e
and the in fs/namespace.c::do_loopback():

        err = -EINVAL;
        if (mnt_ns_loop(old_path.dentry))
                goto out;

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-03 12:38:18 +02:00
Bjarni Ingi Gislason 2c1acf16da man2/*: ffix: change '-' to '\-' for options
Change '-' to '\-' for the prefix of names to indicate an option.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-02 12:20:04 +02:00
Michael Kerrisk feb9ef3848 iopl.2: Minor tweaks to Thomas Piekarski's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-29 13:50:23 +02:00
Thomas Piekarski 6caf6c4380 iopl.2: Updating description of permissions and disabling interrupts
Update description of permissions for port-mapped I/O set
per-thread and not per-process. Mention that iopl() can not
disable interrupts since Linux 5.5 anymore and is in general
deprecated and only provided for legacy X servers.

See https://bugzilla.kernel.org/show_bug.cgi?id=205317

Reported-by: victorm007@yahoo.com
Signed-off-by: Thomas Piekarski <t.piekarski@deloquencia.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-29 13:50:23 +02:00
Michael Kerrisk ada17e7d82 prctl.2: srcfix: add various people to copyright
Based on git history.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-29 13:50:16 +02:00
Michael Kerrisk 236a9f706a prctl.2: Minor fixes to Dave Martin's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-26 13:34:48 +02:00
Dave Martin 9b276f9ea8 prctl.2: Add tagged address ABI control prctls (arm64)
Add documentation for the the PR_SET_TAGGED_ADDR_CTRL and
PR_GET_TAGGED_ADDR_CTRL prctls added in Linux 5.4 for arm64.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-26 13:22:26 +02:00
Michael Kerrisk 7fe3c5a9cf prctl.2: Minor tweaks to Dave Martin's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-26 13:13:19 +02:00
Dave Martin 034f403aa7 prctl.2: Add SVE prctls (arm64)
Add documentation for the the PR_SVE_SET_VL and PR_SVE_GET_VL
prctls added in Linux 4.15 for arm64.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-26 13:06:38 +02:00
Michael Kerrisk 0b06563436 clone.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-26 11:17:44 +02:00
Michael Kerrisk f3061d3662 semctl.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-26 11:15:53 +02:00
Michael Kerrisk f902db6b7d sync.2: Minor fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-26 11:11:20 +02:00
Michael Kerrisk 4e375ad273 sync.2: Minor tweaks to Jeff Layton's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-26 11:11:01 +02:00
Jeff Layton 7b9af2eb80 sync.2: syncfs() now returns errors if writeback fails
A patch has been merged for v5.8 that changes how syncfs() reports
errors. Change the sync() manpage accordingly.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-26 11:01:54 +02:00
Philip Adams aeaf667ec3 tcp.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-26 10:49:16 +02:00
Michael Kerrisk ba6431be3a mmap.2: tfix
Reported-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-25 08:10:21 +02:00
Michael Kerrisk f4077c2c2c sysctl.2: glibc removed support for sysctl() starting in version 2.32
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-23 21:26:51 +02:00
Michael Kerrisk 575bac0fdd connect.2, pidfd_send_signal.2, ptrace.2, socket.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-21 09:26:30 +02:00
Bjarni Ingi Gislason fec6cf90e9 man2/*: srcfix: fix warnings from "mandoc -Tlint"
Remove superfluous paragraph macros.

  Remove ".br" if it is before a line that starts with a space
character, as such lines automatically cause a break.

###

  The output is unchanged, except two empty lines are added at the
bottom (before the footer line) in the output of "nroff" for the files
"alloc_hugepages.2" and "userfaultfd.2".

###

  Examples of warnings from "mandoc -Tlint":

mandoc: access.2:283:2: WARNING: skipping paragraph macro: PP after SH

mandoc: adjtimex.2:185:2: WARNING: skipping paragraph macro: PP empty

mandoc: futex.2:728:2: WARNING: skipping paragraph macro: IP empty

mandoc: getsid.2:48:2: WARNING: skipping paragraph macro: br before text line with leading blank

mandoc: init_module.2:290:2: WARNING: skipping paragraph macro: PP after SS

mandoc: ioctl_fideduperange.2:27:2: WARNING: skipping paragraph macro: br after SH

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-21 09:08:00 +02:00
Michael Kerrisk 247c654385 fstatvfs.2, getcontext.2, getcwd.2, gethostid.2, killpg.2, mq_notify.2, mq_open.2, mq_timedreceive.2, mq_timedsend.2, mq_unlink.2, setcontext.2, sethostid.2, statvfs.2: Remove historical .so links
These links were mostly created when pages were moved between
sections, in almost every case several years ago. The idea
was to allow people time to get used to the new section numbers
while still having commands of the form "man <sec> <page>"
work as before. Let's assume that people have now had time to
get used to the new section numbers, and remove these links.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-20 09:24:32 +02:00
Michael Kerrisk 12e3a797b3 getdtablesize.2, sigqueue.2, clock_getres.3, clock_gettime.3, clock_settime.3, attr.5, numa_maps.5: Remove old links
These are all links that were created several years ago, mainly
when pages were migrated to different sections, in order to
allow the 'man' commands using the old section numbers to work.
However, the plan was always to eventually remove them, after
allowing people who cared to get used to the new section numbers.
Now, after 5+ years in each case, it's time to remove
these links.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-19 20:50:47 +02:00
Oleksandr Kravchuk 32b46e5005 keyctl.2: Declare auth_key
The variable is used in the code example, but not declared,
leading to a compilation error.

Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-19 14:58:54 +02:00
Michael Kerrisk 9d3c4d88c3 setns.2: ERRORS: add ESRCH for PID FD that refers to a terminated process
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-15 22:41:49 +02:00
Michael Kerrisk 8bb318edc8 setns.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-15 22:16:32 +02:00
Michael Kerrisk f072850099 setns.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-15 22:12:42 +02:00
Michael Kerrisk 6c2a93c3ca setns.2: Minor tweak
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-15 16:32:52 +02:00
Michael Kerrisk ea31fdec71 setns.2: Document the use of PID file descriptors with setns()
Starting with Linux 5.8, setns() can take a PID file descriptor as
an argument, and move the caller into or more of the namespaces of
the thread referred to by that descriptor.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-15 16:23:49 +02:00
Michael Kerrisk eca31e6970 pidfd_open.2: Add the setns(2) use case for PID file descriptors
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-15 16:00:42 +02:00
Michael Kerrisk b93ed8895e pidfd_open.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-15 16:00:42 +02:00
Michael Kerrisk 7f52c11c37 setns.2: It is possible to setns() to the caller's current PID namespace
The page currently incorrectly says that 'fd' must refer to
a descendant PID namespace. However, 'fd' can also refer to
the caller's current PID namespace. Verified by experiment,
and also comments in kernel/pid_namespace.c (Linux 5.8-rc1).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-15 15:57:48 +02:00
Michael Kerrisk 0e0984fc38 openat2.2: ffix
Reported-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-12 21:54:55 +02:00
Michael Kerrisk 7d79c71ef1 pidfd_getfd.2: srcfix
Reported-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-12 21:47:21 +02:00
Michael Kerrisk 20b9102ac7 madvise.2: tfix
Reported-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-12 21:46:21 +02:00
Michael Kerrisk 98f89c711b timer_create.2, timerfd_create.2: tfix
Reported-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-12 21:44:55 +02:00
Michael Kerrisk ac6dcc4865 timerfd_create.2: tfix
Reported-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-12 21:44:23 +02:00
Bjarni Ingi Gislason 77ca5b1d08 man2/*: srcfix: trim trailing space
Remove superfluous space at the end of a processed input line.

  There is no change in the output from "nroff" and "groff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-12 21:38:24 +02:00
Michael Kerrisk 0071462373 syscalls.2: Add faccessat2(), added in Linux 5.8
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-12 13:52:17 +02:00
Michael Kerrisk 22f79f9580 chroot.2, utimensat.2, vfork.2, getcwd.3, getdtablesize.3, ualarm.3, usleep.3, rtnetlink.7: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-11 07:52:18 +02:00
Michael Kerrisk 72970931d7 getpagesize.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-11 07:47:23 +02:00
Michael Kerrisk 9bfc9cb197 dup.2, fallocate.2, futex.2, ioctl_fat.2, ioctl_ficlonerange.2, ioctl_fideduperange.2, madvise.2, membarrier.2, mprotect.2, open.2, openat2.2, perf_event_open.2, perfmonctl.2, pipe.2, process_vm_readv.2, s390_pci_mmio_write.2, s390_runtime_instr.2, s390_sthyi.2, set_thread_area.2, sigprocmask.2, subpage_prot.2, unshare.2, cmsg.3, newlocale.3, pthread_setname_np.3, strfmon.3, strfromd.3, tsearch.3, tcp.7, ld.so.8: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-11 07:45:09 +02:00
Michael Kerrisk 0d0da0de86 signal.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-10 11:55:59 +02:00
Michael Kerrisk da16ac098d open.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-10 11:53:47 +02:00
Michael Kerrisk c6ba384bf4 bpf.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-10 11:52:31 +02:00
Michael Kerrisk 3701115420 getdents.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-10 11:49:18 +02:00
Michael Kerrisk 9562b9aee5 dup.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-10 11:48:44 +02:00
Michael Kerrisk 138b60c7b4 prctl.2: wfix
Reported-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 20:09:48 +02:00
Michael Kerrisk bffbb22fda iconv.1, locale.1, memusage.1, memusagestat.1, pldd.1, sprof.1, _syscall.2, add_key.2, adjtimex.2, bind.2, bpf.2, chown.2, clone.2, close.2, copy_file_range.2, eventfd.2, fanotify_init.2, fanotify_mark.2, fork.2, fsync.2, futex.2, getdents.2, getrlimit.2, getxattr.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, ioctl_fat.2, ioctl_getfsmap.2, ioctl_ns.2, ioctl_tty.2, ioctl_userfaultfd.2, kcmp.2, keyctl.2, listen.2, listxattr.2, mbind.2, membarrier.2, memfd_create.2, mkdir.2, move_pages.2, mremap.2, msync.2, nfsservctl.2, open.2, perf_event_open.2, pidfd_send_signal.2, pipe.2, pivot_root.2, pkey_alloc.2, process_vm_readv.2, ptrace.2, readlink.2, readv.2, recv.2, recvmmsg.2, rename.2, request_key.2, s390_runtime_instr.2, sched_setaffinity.2, seccomp.2, send.2, sendmmsg.2, sigaltstack.2, signalfd.2, socket.2, socketpair.2, splice.2, spu_create.2, spu_run.2, statfs.2, syscall.2, sysctl.2, sysfs.2, tee.2, timer_getoverrun.2, timer_settime.2, umount.2, userfaultfd.2, utimensat.2, wait4.2, INFINITY.3, __ppc_get_timebase.3, __setfpucw.3, abort.3, aio_cancel.3, aio_error.3, aio_read.3, aio_return.3, atexit.3, backtrace.3, basename.3, bsearch.3, bswap.3, cacos.3, cacosh.3, catan.3, catanh.3, cexp2.3, clock_getcpuclockid.3, clog2.3, cmsg.3, confstr.3, div.3, dl_iterate_phdr.3, dlerror.3, dlinfo.3, dlopen.3, dlsym.3, duplocale.3, encrypt.3, end.3, endian.3, envz_add.3, err.3, expm1.3, fdim.3, flockfile.3, fmtmsg.3, frexp.3, ftw.3, get_nprocs_conf.3, get_phys_pages.3, getaddrinfo_a.3, getauxval.3, getdate.3, getdtablesize.3, getgrent_r.3, getgrouplist.3, gethostbyname.3, getline.3, getnameinfo.3, getopt.3, getprotoent_r.3, getpwent_r.3, getpwnam.3, getservent_r.3, getsubopt.3, getutent.3, glob.3, gnu_get_libc_version.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_ntop.3, inet_pton.3, insque.3, killpg.3, makecontext.3, mallinfo.3, malloc.3, malloc_hook.3, malloc_info.3, mallopt.3, matherr.3, mbsnrtowcs.3, mbstowcs.3, mcheck.3, mempcpy.3, mq_getattr.3, mq_notify.3, mtrace.3, newlocale.3, nextafter.3, ntp_gettime.3, offsetof.3, open_memstream.3, pow.3, printf.3, pthread_attr_init.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setstack.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_create.3, pthread_detach.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_join.3, pthread_mutex_consistent.3, pthread_mutexattr_setrobust.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_spin_init.3, pthread_testcancel.3, pthread_tryjoin_np.3, ptsname.3, qsort.3, rand.3, random.3, remainder.3, rpmatch.3, rtime.3, rtnetlink.3, scalb.3, scalbln.3, scandir.3, sem_getvalue.3, sem_wait.3, setaliasent.3, setlogmask.3, sigwait.3, sincos.3, sockatmark.3, stdarg.3, stpcpy.3, strcat.3, strfmon.3, strptime.3, strtod.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, tsearch.3, uselocale.3, wcstok.3, wcstombs.3, wordexp.3, y0.3, loop.4, vcs.4, veth.4, charmap.5, core.5, filesystems.5, gai.conf.5, hosts.5, hosts.equiv.5, locale.5, nss.5, repertoiremap.5, securetty.5, shells.5, ttytype.5, ascii.7, complex.7, cpuset.7, credentials.7, fanotify.7, hier.7, inotify.7, ip.7, mount_namespaces.7, mq_overview.7, netlink.7, network_namespaces.7, pid_namespaces.7, pkeys.7, rtld-audit.7, rtnetlink.7, sem_overview.7, signal-safety.7, sock_diag.7, spufs.7, standards.7, symlink.7, tcp.7, time_namespaces.7, unix.7, user_namespaces.7, xattr.7, ldconfig.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 14:48:40 +02:00
Michael Kerrisk fd85c2387b openat2.2, proc.5, bpf-helpers.7: srcfix: strip trailing whitespace
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 14:48:40 +02:00
Michael Kerrisk 7289930f20 prctl.2: Fixes to Dave Martin's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 13:33:23 +02:00
Dave Martin 8165500d4c prctl.2: Add PR_PAC_RESET_KEYS (arm64)
Add documentation for the PR_PAC_RESET_KEYS ioctl added in Linux
5.0 for arm64.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Amit Daniel Kachhap <amit.kachhap@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 13:30:57 +02:00
Michael Kerrisk c3a523e07d prctl.2: Add reference to proc(5) for /proc/self/task/[tid]/comm
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 12:39:17 +02:00
Michael Kerrisk 492a8b724f connect.2: Minor tweaks to Stefan Puiu's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 10:17:34 +02:00
Stefan Puiu 375c65a9c2 connect.2: Can return EACCES because of SELinux
Recently I had to troubleshoot a problem where a connect() call
was returning EACCES:

17648 socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 37
17648 connect(37, {sa_family=AF_INET, sin_port=htons(8081),
sin_addr=inet_addr("10.12.1.201")}, 16) = -1 EACCES (Permission
denied)

I've traced this to SELinux policy denying the connection. This is
on a Fedora 23 VM:

$ cat /etc/redhat-release
Fedora release 23 (Twenty Three)
$ uname -a
Linux mako-fedora-01 4.8.13-100.fc23.x86_64 #1 SMP Fri Dec 9 14:51:40
UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

The manpage says this can happen when connecting to a broadcast
address, or when a local firewall rule blocks the connection.
However, the address above is unicast, and using 'wget' from
another account to access the URL works fine.

The context is that we're building an OS image, and this involves
downloading RPMs through a proxy. The proxy (polipo) is labelled
by SELinux, and I guess there is some sort of policy that says
"proxy can only connect to HTTP ports". When trying to connect to
a server listening on a port that is not labeled as an HTTP server
port, I guess SELinux steps in. With 'setenforce 0', the build
works fine. In the kernel sources I see connect() calls
security_socket_connect() (see
https://elixir.bootlin.com/linux/latest/source/net/socket.c#L1855),
which calls whatever security hooks are registered. I see the
SELinux hook getting registered at
https://elixir.bootlin.com/linux/latest/source/security/selinux/hooks.c#L7047,
and setting a perf probe on the call proves that the
selinux_socket_connect function gets called (while
tcp_v4_connect() is not).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 10:09:55 +02:00
Michael Kerrisk 599e0cef94 ioctl.2: Remove mentions of ioctl_list(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 09:40:08 +02:00
Michael Kerrisk 3de87d4684 ioctl_list.2: Remove this page
This page was first added more than 20 years ago. Since
that time it has seen hardly any update, and is by now
very much out of date, as reported by Heinrich Schuchardt
and confirmed by Eugene Syromyatnikov.

As Heinrich says:

    Man-pages like netdevices.7 or ioctl_fat.2 are what is
    needed to help a user who does not want to read through the
    kernel code.

    If ioctl_list.2 has not been reasonably maintained since
    Linux 1.3.27 and hence is not a reliable source of
    information, shouldn't it be dropped?

My answer is, yes (but let's move a little info into ioctl(2)).

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reported-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 09:40:08 +02:00
Michael Kerrisk 91b00e53b3 ioctl.2: Move subsection on "ioctl structure" from ioctl_list(2) to ioctl(2)
In preparation for removing ioctl_list(2), let's preserve
some useful text that was added to ioctl_list(2)
by Andries Brouwer.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 09:40:08 +02:00
Michael Kerrisk 02e701cde3 syscall.2: Minor wording tweaks
Reported-by: Jonny Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 23:09:36 +02:00
Amir Goldstein e9898cc8ba fanotify.7, fanotify_mark.2: Clarify FAN_ONDIR in output mask
FAN_ONDIR was an input only flag before introducing
FAN_REPORT_FID.  Since the introduction of FAN_REPORT_FID, it can
also be in output mask.

Move the text describing its role in the output mask to fanotify.7
where the other output mask bits are documented.

[mtk: commit message tidy-up]

Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 23:07:59 +02:00
Amir Goldstein e5a800c135 fanotify_init.2: Move out of place entry FAN_REPORT_FID
It was inserted in the middle of the FAN_CLASS_ multi flags bit
and broke the multi flag documentation.

Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 22:16:40 +02:00
Amir Goldstein c3a3f611f6 fanotify.7, fanotify_mark.2: Revert "fanotify.7, fanotify_mark.2: Document FAN_DIR_MODIFY"
This reverts commit a93e5c9593.

FAN_DIR_MODIFY was disabled for v5.7 release by kernel commit
f17936993af0 ("fanotify: turn off support for FAN_DIR_MODIFY").

Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 22:16:34 +02:00