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
John A. Leuenhagen
5115a7dede
feature_test_macros.7: tfix
...
Signed-off-by: John A. Leuenhagen <john@zlima12.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-02 08:43:32 +01:00
Michael Kerrisk
07d6c242cf
Start of man-pages-5.10: updating Changes and Changes.old
2020-11-02 07:58:09 +01:00
Michael Kerrisk
db9c2b96ab
Start of man-pages-5.10: updating .Announce and .lsm files
2020-11-02 07:58:09 +01:00
Michael Kerrisk
40e13069d9
Start of man-pages-5.10: renaming .Announce and .lsm files
2020-11-02 07:58:09 +01:00
Michael Kerrisk
2b71d80b72
Ready for 5.09
2020-11-01 21:56:08 +01:00
Michael Kerrisk
1184825216
Changes: whitespace cleanups
2020-11-01 21:56:08 +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
Michael Kerrisk
da11ac24e1
Changes: tfix
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 21:56:08 +01:00
Michael Kerrisk
9a81a9fd8d
Changes: Ready for 5.09
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 21:16:29 +01:00
Michael Kerrisk
7722ae4804
bpf-helpers.7: tfix
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 21:16:29 +01:00
Michael Kerrisk
152ce70f53
pthread_attr_init.3: tfix
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 21:06:53 +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
706d4f73ae
pthread_attr_init.3: SEE ALSO: add pthread_attr_init(3)
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 18:18:13 +01:00
Michael Kerrisk
96841f0e25
pthread_sigmask.3: SEE ALSO: add pthread_attr_setsigmask_np(3)
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 18:18:13 +01:00
Michael Kerrisk
340f4f9e7c
pthread_attr_setsigmask_np.3: New page for pthread_attr_setsigmask_np() + pthread_attr_getsigmask_np()
...
Add a page documenting the pthread_attr_setsigmask_np(3) and
pthread_attr_getsigmask_np() functions added in glibc 2.32.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-01 18:18:13 +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
Michael Kerrisk
e9c09849cc
dlopen.3: ffix
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-31 10:17:00 +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
Alejandro Colomar
93f369892a
strtol.3: EXAMPLES: Simplify errno checking
...
(No expected change in behavior,)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 11:12:22 +01:00
Alejandro Colomar
b924e6b65a
strtol.3: EXAMPLES: As the default base, use special value 0
...
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 11:11:25 +01:00
Alejandro Colomar
d01c330357
strtol.3: EXAMPLES: Delimit output string using ""
...
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 11:11:12 +01:00
Michael Kerrisk
10414db19b
man_show_fixme.sh: Don't hyphenate or justify the manual page
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 09:42:41 +01:00
Michael Kerrisk
820e13fbd4
socket.7: srcfix: rewrap source lines
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 07:20:31 +01:00
Sridhar Samudrala
e8500ecc78
socket.7: Document SO_INCOMING_NAPI_ID
...
Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 07:15:43 +01:00
Michael Kerrisk
f36f4f855b
strtol.3: ffix
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 07:01:01 +01:00
Michael Kerrisk
b6a968bca7
strtol.3: srcfix: Add myself to copyright
...
I added the xample program in 2006, but omitted to add myself to the
copyright.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 20:00:23 +01:00
Michael Kerrisk
30d41ce662
FIXME_list.sh: Fix broken regexp
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 19:42:47 +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
Alejandro Colomar
900d564055
system_data_types.7: off_t: Add note about _FILE_OFFSET_BITS
...
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 17:34:55 +01:00
Michael Kerrisk
8573214f58
lseek64.3: Since glibc 2.28. the 'llseek' symbol is no longer available
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 17:08:18 +01:00
Jann Horn
20e43cd694
proc.5: Document inaccurate RSS due to SPLIT_RSS_COUNTING
...
[mtk: Manually applied patch, because of conflicts with other
merged changes; also added an edit suggested by Jann; see the
thread at
https://lore.kernel.org/linux-man/20201012114940.1317510-1-jannh@google.com/ ]
Since 34e55232e59f7b19050267a05ff1226e5cd122a5 (introduced back in
v2.6.34), Linux uses per-thread RSS counters to reduce cache
contention on the per-mm counters. With a 4K page size, that means
that you can end up with the counters off by up to 252KiB per
thread.
Example:
$ cat rsstest.c
#include <stdlib.h>
#include <err.h>
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/eventfd.h>
#include <sys/prctl.h>
void dump(int pid) {
char cmd[1000];
sprintf(cmd,
"grep '^VmRSS' /proc/%d/status;"
"grep '^Rss:' /proc/%d/smaps_rollup;"
"echo",
pid, pid
);
system(cmd);
}
int main(void) {
eventfd_t dummy;
int child_wait = eventfd(0, EFD_SEMAPHORE|EFD_CLOEXEC);
int child_resume = eventfd(0, EFD_SEMAPHORE|EFD_CLOEXEC);
if (child_wait == -1 || child_resume == -1) err(1, "eventfd");
pid_t child = fork();
if (child == -1) err(1, "fork");
if (child == 0) {
if (prctl(PR_SET_PDEATHSIG, SIGKILL)) err(1, "PDEATHSIG");
if (getppid() == 1) exit(0);
char *mapping = mmap(NULL, 80 * 0x1000, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
eventfd_write(child_wait, 1);
eventfd_read(child_resume, &dummy);
for (int i=0; i<40; i++) mapping[0x1000 * i] = 1;
eventfd_write(child_wait, 1);
eventfd_read(child_resume, &dummy);
for (int i=40; i<80; i++) mapping[0x1000 * i] = 1;
eventfd_write(child_wait, 1);
eventfd_read(child_resume, &dummy);
exit(0);
}
eventfd_read(child_wait, &dummy);
dump(child);
eventfd_write(child_resume, 1);
eventfd_read(child_wait, &dummy);
dump(child);
eventfd_write(child_resume, 1);
eventfd_read(child_wait, &dummy);
dump(child);
eventfd_write(child_resume, 1);
exit(0);
}
$ gcc -o rsstest rsstest.c && ./rsstest
VmRSS: 68 kB
Rss: 616 kB
VmRSS: 68 kB
Rss: 776 kB
VmRSS: 812 kB
Rss: 936 kB
$
Let's document that those counters aren't entirely accurate.
Reported-by: Mark Mossberg <mark.mossberg@gmail.com>
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:52:08 +01:00
Michael Kerrisk
14948ad6ec
proc.5: Minor fixes
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Michael Kerrisk
bd13ace0c5
proc.5: ffix: use a hanging list as is done elsewhere in the page
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Alejandro Colomar
4492c4bf2c
system_data_types.7: ffix
...
Format section names inside each type.
Follow the same pattern as in stat.2 (see line 158: ".IR Note :")
Before this ffix, it was visually harder to find sections inside a type.
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Alejandro Colomar
476e632b65
system_data_types.7: ffix
...
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Michael Kerrisk
2fbfb575b8
capabilities.7: Under CAP_SYS_ADMIN, group "sub-capabilities" together
...
CAP_BPF, CAP_PERFMON, and CAP_CHECKPOINT_RESTORE have all been
added to split out the power of CAP_SYS_ADMIN into weaker pieces.
Group all of these capabilities together in the list under
CAP_SYS_ADMIN, to make it clear that there is a pattern to these
capabilities.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Michael Kerrisk
045c5bde77
capabilities.7: CAP_SYS_ADMIN implies CAP_CHECKPOINT_RESTORE
...
But the latter, weaker capability is preferred.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Michael Kerrisk
a526aa4040
capabilities.7: tfix
...
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00