Commit Graph

8436 Commits

Author SHA1 Message Date
Kirill Smelkov 90fb5f5225 mmap.2: srcfix: note kernel commit that caused MAP_POPULATE | MAP_NONBLOCK to be noop
Signed-off-by: Kirill Smelkov <kirr@nexedi.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-17 13:24:48 +02:00
Peter Wu 0e86195223 bpf.2: Update enum bpf_map_type and enum bpf_prog_type
Taken from Linux v5.3-rc2. Add a reference to the header file to
save the future reader some time figuring out whether more entries
exist.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-17 12:08:10 +02:00
Michael Kerrisk f7d706ba9b bpf.2: srcfix: Add a note on check for unprivileged BPF_PROG_TYPE_SOCKET_FILTER programs
In Linux 4.4, the allowed BPF helper functions that could
be called was governed by a check in sk_filter_func_proto().
Nowadays (Linux 5.6), it is I think governed by the check in
sk_filter_func_proto().

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-17 11:58:35 +02:00
Michael Kerrisk 35732aa7a0 bpf.2: Minor tweaks to Richard Palethorpe's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-17 11:49:42 +02:00
Richard Palethorpe 821bf91cf6 bpf.2: Change note on unprivileged access
This notes that the kernel now allows calls to bpf() without CAP_SYS_ADMIN
under some circumstances.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-17 09:27:32 +02:00
Michael Kerrisk 2a2b2a5dd7 clone.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-17 09:06:20 +02:00
Michael Kerrisk d407f83e5f move_pages.2: Minor tweaks to Yang Shi's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 13:34:39 +02:00
Yang Shi e7b72190bb move_pages.2: Returning positive value is a new error case
Since commit a49bd4d71637 ("mm, numa: rework do_pages_move"), the
semantic of move_pages() has changed to return the number of
non-migrated pages if they were result of a non-fatal reasons
(usually a busy page).  This was an unintentional change that
hasn't been noticed except for LTP tests which checked for the
documented behavior.

There are two ways to go around this change.  We can even get back
to the original behavior and return -EAGAIN whenever migrate_pages
is not able to migrate pages due to non-fatal reasons.  Another
option would be to simply continue with the changed semantic and
extend move_pages documentation to clarify that -errno is returned
on an invalid input or when migration simply cannot succeed (e.g.
-ENOMEM, -EBUSY) or the number of pages that couldn't have been
migrated due to ephemeral reasons (e.g. page is pinned or locked
for other reasons).

We decided to keep the second option in kernel because this
behavior is in place for some time without anybody complaining and
possibly new users depending on it.  Also it allows to have a
slightly easier error handling as the caller knows that it is
worth to retry when err > 0.

Update man pages to reflect the new semantic.

Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 13:30:02 +02:00
Michael Kerrisk 34451e6ee4 s390_runtime_instr.2: Various reworking of Heiko Carstens's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 12:30:00 +02:00
Michael Kerrisk fee6e6795e s390_runtime_instr.2: srcfix: rewrap long source lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 12:18:19 +02:00
Heiko Carstens cca27058b7 s390_runtime_instr.2: Document signum argument behavior change
Document that the signum argument is ignored in newer kernels, but
that user space should pass a valid real-time signal number for
backwards compatibility.

Cowritten-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 12:10:07 +02:00
Michael Kerrisk bff15b74e0 msgctl.2: Correct description of 'msg_ctime' field
Verified by inspecting kernel source.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 11:48:08 +02:00
Michael Kerrisk 6cd15a0567 shmctl.2: f
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 11:47:16 +02:00
Michael Kerrisk a85bc85d5d shmctl.2: Correct 'shm_ctime' description
Verified from kernel sources.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 11:41:47 +02:00
Michael Kerrisk 5fd4345e84 semctl.2: Correct description of sem_ctime field
Verified from inspection of kernel source code.

Reported-by: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 11:33:17 +02:00
Michael Kerrisk 6fea5f4f1d semctl.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 11:27:19 +02:00
Michael Kerrisk 191dd3b238 mremap.2: Remove mention of "Segmentation fault" in EFAULT text
"Segmentation fault" (SIGSEGV) is not exactly the same thing as
EFAULT.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:23:09 +02:00
Michael Kerrisk 4737f0d145 mremap.2: Move a paragraph on MREMAP_DONTUNMAP from NOTES to DESCRIPTION
I think things read slightly easier, if all of the info on
MREMAP_DONTUNMAP is in one place.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:21:30 +02:00
Michael Kerrisk f15e32e3b9 mremap.2: Move a paragraph from DESCRIPTION to NOTES
The paragraph on Linux VM is rather generic, and does not belong
in DESCRIPTION. In fact, I'm not sure it even belongs in this
page.  At the least, let's move it to NOTES.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:20:12 +02:00
Michael Kerrisk 8c97c565ee mremap.2: Move a paragraph from DESCRIPTION to NOTES
And while we are at it, remove a sentence that makes an obvious
point (that mremap() uses the Linux page table scheme).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:20:12 +02:00
Michael Kerrisk 2b4fecb9f6 mremap.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:20:12 +02:00
Michael Kerrisk 6af75e77bb mremap.2: Reorder some paragraphs in NOTES
Details of glibc 2.4, which is by now fairly old, would be
better at the end of NOTES than at the start.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:20:12 +02:00
Michael Kerrisk 0f0993c9b5 mremap.2: Some more improvements to Brian Geffon's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:20:01 +02:00
Michael Kerrisk 452bdc2f02 mremap.2: Minor tweaks to Brian Geffon's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 07:30:00 +02:00
Brian Geffon 8debc4f595 mremap.2: Document MREMAP_DONTUNMAP
Signed-off-by: Brian Geffon <bgeffon@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 07:30:00 +02:00
Michael Kerrisk cb76d6e5fe mremap.2: ffix (Add a paragraph break)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 07:30:00 +02:00
Michael Kerrisk 2932c4aa7e openat2.2: A few more fixes after feedback from Aleksa Sarai
Reported-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 22:07:39 +02:00
Michael Kerrisk 9154da7f05 mmap.2: Don't mark MAP_ANON as deprecated
From a mailing list conversation:

On 5/24/18 9:03 PM, Heinrich Schuchardt wrote:
> Hello Michael,
>
> in the mmap(2) man page MAP_ANON is described as deprecated.
>
> When I look at the NetBSD manpage
> http://netbsd.gw.com/cgi-bin/man-cgi?mmap+2+NetBSD-current
> I found that MAP_ANONYMOUS is not defined.
>
> https://www.dragonflybsd.org/cgi/web-man?command=mmap&section=2
> indicates MAP_ANONYMOUS is an alias for MAP_ANON and is provided for
> compatibility.
>
> https://man.openbsd.org/mmap.2 also knows MAP_ANONYMOUS as a synonym.
>
> https://www.unix.com/man-page/osx/2/mmap/ does not know MAP_ANONYMOUS.
>
> So shouldn't the man page indicate that MAP_ANON is to be favored to
> write portable code? And correspondingly mark MAP_ANONYMOUS as synonym
> only kept for compatibility.
>
> The Open Group Base Specifications Issue 7, 2018 Edition does not
> reference either of both. So both values are not POSIX but it is not
> correct to describe them as Linux only.

The text saying that MAP_ANON is deprecated is ancient (at least
20 years old). I don't know why that text was added.

Things are not simple though: it looks like there's at least
one historical implementation (HP-US) that defines MAP_ANONYMOUS
but not MAP_ANON.

I've applied the patch below.

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 21:14:12 +02:00
Michael Kerrisk ebf3a7d52a ioctl_list.2: Remove hex values from constants
As noted by Heinrich Schuchardt:

he list contains hex values of different constants. I just wonder for
which architecture (alpha, i386, mips, or sparc at that time). No
information is supplied.

Current values depend on the architecture, e.g.

On amd64
0x82307201      VFAT_IOCTL_READDIR_BOTH
0x82307202      VFAT_IOCTL_READDIR_SHORT
0x80047210      FAT_IOCTL_GET_ATTRIBUTES
0x40047211      FAT_IOCTL_SET_ATTRIBUTES
0x80047213      FAT_IOCTL_GET_VOLUME_ID

On mips
0x42187201      VFAT_IOCTL_READDIR_BOTH
0x42187202      VFAT_IOCTL_READDIR_SHORT
0x40047210      FAT_IOCTL_GET_ATTRIBUTES
0x80047211      FAT_IOCTL_SET_ATTRIBUTES
0x40047213      FAT_IOCTL_GET_VOLUME_ID

Hence hex values should be removed.

Reported-by:
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 13:06:24 +02:00
Michael Kerrisk dfa3ae9b3f getdents.2: Tweaks to Petr Vorel's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 11:42:21 +02:00
Petr Vorel f5f6969dee getdents.2: Mention glibc support for getdents64()
Support was added in glibc 2.30.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 11:38:39 +02:00
Chris Lamb 15a8a16b8e getdents.2: Correct linux_dirent definition in example code
It is "unsigned long" earlier up in the file

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 11:36:51 +02:00
Goldwyn Rodrigues 1083ffb4cb utimensat: Immutable flag returns EPERM
Linux kernel commit 337684a1746f "fs: return EPERM on immutable
inode" changed (nd unified the return value of the utimensat(2)
from -EACCES to -EPERM in case of an immutable flag. Modify the
man page to reflect the same.

The entire discussion of returning the correct return value is at:
http://lists.linux.it/pipermail/ltp/2017-January/003424.html

[mtk: The change was in Linux 4.8]

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 10:38:58 +02:00
Michael Kerrisk d7695b17b1 arch_prctl.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 08:36:07 +02:00
Michael Kerrisk d9e7db1b39 open.2: Tweaks to Joseph Sible's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:48 +02:00
Joseph C. Sible 2ddf885a4f open.2: Document fs.protected_fifos and fs.protected_regular
The sysctls fs.protected_fifos and fs.protected_regular can cause
open(2) to fail with EACCES (see Documentation/sysctl/fs.rst for
details.)

Signed-off-by: Joseph C. Sible <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:48 +02:00
Michael Kerrisk 43c257eaf3 io_setup.2: Tweak description of /proc/sys/fs/aio-max-nr
As far as I can see, /proc/sys/fs/aio-max-nr is a
system-wide limit, not a per-user limit. This seems to be
confirmed by comments in fs/aio.c (Linux 5.6) sources).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:48 +02:00
Michael Kerrisk 10e29c059b sendfile.2: wfix
Reported-by: Joseph C. Sible <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:47 +02:00
Michael Kerrisk 731192bee0 ptrace.2: srcfix: mention strace's linux/*/set_scno.c files in relation to PTRACE_SET_SYSCALL
Reported-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:47 +02:00
Michael Kerrisk cbda5fc9de ptrace.2: Minor tweaks to Joseph Sible's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:44 +02:00
Joseph C. Sible c2254484e3 ptrace.2: Document PTRACE_SET_SYSCALL
Signed-off-by: Joseph C. Sible <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 10:29:03 +02:00
Michael Kerrisk d31cdf430e openat2.2: Various changes after feedback from Aleksa Sarai
Reported-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 09:21:20 +02:00
Michael Kerrisk 8e79683820 mbind.2: Rework Li Xinhai's patch to note historical behavior
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-12 09:35:41 +02:00
Li Xinhai dfbaab2f19 mbind.2: Remove note about MPOL_MF_STRICT been ignored
Current code ignores the MPOL_MF_STRICT when handling hugetlb
mapping, now patch([1]) handles MPOL_MF_STRICT in same semantic as
other mapping.  So, we can remove the note about 'MPOL_MF_STRICT
is ignored on huge page mappings', and no changes to other part of
man-page.

[1] https://lore.kernel.org/linux-mm/1581559627-6206-1-git-send-email-lixinhai.lxh@gmail.com/

Signed-off-by: Li Xinhai <lixinhai.lxh@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-12 09:35:41 +02:00
Michael Kerrisk 1a576c5858 shmop.2: Add license to example programs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-12 09:11:20 +02:00
Michael Kerrisk 78391fde75 poll.2: Add license to example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-12 09:11:20 +02:00
Michael Kerrisk 927e2764ab semget.2: Add license to example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-12 09:11:16 +02:00
Michael Kerrisk 8678102abe pidfd_getfd.2, select.2, exit.3, time.7, time_namespaces.7: srcfix: Trim trailing white spaces
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-11 22:33:10 +02:00
Michael Kerrisk e8426ca2b4 getent.1, localedef.1, accept.2, arch_prctl.2, clock_getres.2, clock_nanosleep.2, connect.2, dup.2, epoll_create.2, epoll_ctl.2, epoll_wait.2, execve.2, getitimer.2, getsockopt.2, gettid.2, inotify_add_watch.2, inotify_init.2, io_submit.2, ioctl.2, lseek.2, madvise.2, mlock.2, mmap.2, mprotect.2, msgctl.2, msgop.2, open_by_handle_at.2, openat2.2, pidfd_open.2, poll.2, prctl.2, quotactl.2, s390_sthyi.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, setns.2, shmctl.2, shmget.2, shmop.2, sigaction.2, stat.2, statx.2, syscalls.2, timer_create.2, timerfd_create.2, unshare.2, wait.2, CPU_SET.3, aio_init.3, atoi.3, des_crypt.3, dirfd.3, fmemopen.3, fopencookie.3, ftok.3, fts.3, getaddrinfo.3, getifaddrs.3, getrpcent.3, gsignal.3, lio_listio.3, nl_langinfo.3, posix_memalign.3, posix_openpt.3, posix_spawn.3, scanf.3, sem_init.3, sem_post.3, shm_open.3, strcmp.3, strftime.3, st.4, elf.5, group.5, proc.5, services.5, aio.7, cgroups.7, feature_test_macros.7, keyrings.7, man-pages.7, namespaces.7, path_resolution.7, sigevent.7, signal.7, socket.7, sysvipc.7, time.7, udp.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-11 22:07:24 +02:00
Michael Kerrisk 68220f1c6a clock_getres.2: SEE ALSO: add time_namespaces(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-11 21:38:07 +02:00