Commit Graph

19500 Commits

Author SHA1 Message Date
Michael Kerrisk 51d8bd5745 string.3, strlen.3, strnlen.3: Use 'bytes' not 'characters'
This is inline with POSIX terminology. See also the earlier
commit a00b7454b8 (in 2012)
which fixed most of these cases.

Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-04 11:30:53 +02:00
Nikola Forró bf8fc2759b proc.5: Document /proc/[pid]/status Speculation_Store_Bypass field
Signed-off-by: Nikola Forró <nforro@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-04 10:19:30 +02:00
Michael Kerrisk b84a64f4c8 proc.5: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-04 09:23:36 +02:00
Keno Fischer 0aae409212 proc.5: Correct description of NStgid
The left-most pid namespace in a given procfs' `NStgid` does not
change based on the pid namespace of the reading process. Rather,
each procfs has an associated outer-most namespace, which gets
set when the procfs is mounted:

```
static struct dentry *proc_mount(struct file_system_type *fs_type,
	int flags, const char *dev_name, void *data)
{
	struct pid_namespace *ns;

	if (flags & MS_KERNMOUNT) {
		ns = data;
		data = NULL;
	} else {
		ns = task_active_pid_ns(current);
	}

	return mount_ns(fs_type, flags, data, ns, ns->user_ns, proc_fill_super);
}
```

i.e. either the root namespace for kernel mounts or the namespace
of the mounting process. This ns then gets saved in the fs' super
block and is the basis for most operations. It is this ns that the
left-most value of `NStgid` is relative to, not the reading process.

Reported-by: Robert O'Callahan <robert@ocallahan.org>
Signed-off-by: Keno Fischer <keno@juliacomputing.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-04 09:15:56 +02:00
Michael Kerrisk 04ad932426 pthread_attr_init.3: Use correct printf() specifier for "size_t" in example program
Reported-by: Göran Häggsjö <goran.haggsjo@icloud.com>
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 16:13:40 +02:00
Mark Schott 956dc82722 sched_yield.2: tfix
Reported-by: Luka Macan <Luka.Macan@fer.hr>
Change "read-time" to "real-time".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 16:07:59 +02:00
Michael Kerrisk 0d59d0c8bf capabilities.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 16:07:59 +02:00
Antonio Ospite ff2882fda9 uselocale.3: tfix
LC_GLOBAL_HANDLE is not defined anywhere, the doc meant LC_GLOBAL_LOCALE
instead.

Reported-by: Solal Pirelli <solal.pirelli@gmail.com>
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 16:07:43 +02:00
Michael Kerrisk 78bffc453a utmp.5: ffix
Reported-by: Sam Varshavchik <mrsam@courier-mta.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:57:51 +02:00
Michael Kerrisk 92e7c0c6fa perf_event_open.2: ffix
Reported-by: Sam Varshavchik <mrsam@courier-mta.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:55:35 +02:00
Michael Kerrisk 30fd4d6865 seccomp.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:53:03 +02:00
Michael Kerrisk 50c7074665 posixoptions.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:53:03 +02:00
Michael Kerrisk 937a218ce5 getmntent.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:53:03 +02:00
Michael Kerrisk c36ac88feb bpf.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:53:03 +02:00
Michael Kerrisk b761ddde06 smartpqi.4: ffix
Reported-by: Sam Varshavchik <mrsam@courier-mta.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:52:59 +02:00
Michael Kerrisk 32af2a80e2 perf_event_open.2: tfix
Reported-by: Sam Varshavchik <mrsam@courier-mta.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:40:33 +02:00
Michael Kerrisk 1fa5de13d4 getutent.3: tfix
Reported-by: Sam Varshavchik <mrsam@courier-mta.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:38:08 +02:00
Michael Kerrisk 66af361c68 getopt.3: ffix
Reported-by: Sam Varshavchik <mrsam@courier-mta.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:35:22 +02:00
Michael Kerrisk 3426f62cea namespaces.7: Mention ioctl(2) in discussion of namespaces APIs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 07:36:48 +02:00
Michael Kerrisk 9a6d888cb6 namespaces.7: List factors that may pin a namespace into existence
Various factors may pin a namespace into existence, even when it
has no member processes.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 07:30:17 +02:00
Michael Kerrisk 2337d75ee0 seccomp.2: SEE ALSO: add bpfc(1)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-31 17:19:35 +02:00
Michael Kerrisk 1f1c28e0a9 unshare.2: Same EINVAL errors as for clone(2) can also occur with unshare(2)
The EINVAL errors that can occur for clone(2) when it is called
with various CLONE_NEW* flags and the kernel was not configured
with support for the corresponding namespace can also occur for
unshare(2).  (As far as I can see, these errors don't occur for
either clone(2) or unshare(2) when it comes to CLONE_NEWNS and
CLONE_NEWCGROUP.)

Reported-by: Shawn Landden <shawn@git.icu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 20:54:01 +02:00
Michael Kerrisk 231d0bbe7e clone.2: ERRORS: EINVAL occurs with CLONE_NEWUSER if !CONFIG_USER_NS
Note that EINVAL can occur with CLONE_NEWUSER if the kernel was
not configured with CONFIG_USER_NS.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 20:38:03 +02:00
Michael Kerrisk 832fe8eab7 clone.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 20:37:04 +02:00
Michael Kerrisk 7df0e773c7 unix.7: wfix: s/foreign process/peer process/
The more common parlance these days is, I think, "peer".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 12:30:44 +02:00
Michael Kerrisk 94950b9a68 socket.7, unix.7: Move text describing SO_PEERCRED from socket(7) to unix(7)
This is, AFAIK, an option specific to UNIX domain sockets, so
place it in unix(7).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 12:30:44 +02:00
Michael Kerrisk ffab8460c6 unix.7: Refer reader to socket(7) for information about SO_PEEK_OFF
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 12:30:44 +02:00
Michael Kerrisk 2fc7c74cc5 socket.7: Refer reader to unix(7) for information on SO_PASSSEC
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 12:30:44 +02:00
Michael Kerrisk 48c2b7065d tcp.7, udp.7: Add a reference to socket(7) noting existence of further socket options
Some other socket options that are applicable for TCP and UDP sockets
are documented in socket(7), so help the reader by pointing them at
that page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 12:30:44 +02:00
Michael Kerrisk 670387c122 udp.7: srcfix: add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 12:30:44 +02:00
Michael Kerrisk 1221abb60e unix.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 12:30:44 +02:00
Michael Kerrisk ffad6a017f unix.7: Document SCM_SECURITY ancillary data
And fix a wording error in the description of SO_PASSSEC.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 12:30:44 +02:00
Michael Kerrisk 366a9bffc8 unix.7: Document SO_PASSSEC
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-28 11:50:11 +02:00
Michael Kerrisk d91b7522a2 cmsg.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-25 10:27:41 +02:00
Michael Kerrisk 3f796b3817 select_tut.2: Diagnose inet_aton() errors with simple fprintf() (not perror())
When it fails, inet_aton() does not set errno, so using
perror() is not appropriate.

Reported-by: Antonio Chirizzi <antonio.chirizzi@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-20 22:29:35 +02:00
Michael Kerrisk 8c420ed87d proc.5: Explain how to determine top-most mount in /proc/PID/mountinfo
Explain how to determine the top-most mount at a particular
location by inspecting /proc/PID/mountinfo.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-19 00:13:47 +02:00
Michael Kerrisk bdf4703297 chroot.2: Mention /proc/[pid]/root
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-18 21:41:03 +02:00
Michael Kerrisk e06763febd statx.2: Library support for statx() was added in glibc 2.28
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-17 12:33:21 +02:00
Michael Kerrisk 3678dcc906 rename.2: glibc 2.28 adds library support for renameat2()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-17 12:32:29 +02:00
Michael Kerrisk e5604914d7 cmsg.3: Remove unnecessary 'fdptr' intermediate variable in example code
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-17 12:26:29 +02:00
Michael Kerrisk 5af0f223d1 unix.7: Ancillary data forms a barrier when receiving on a stream socket
Thanks to a tip from Keith Packard:
https://keithp.com/blogs/fd-passing/
(Also verified by experiment.)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-17 09:39:56 +02:00
Michael Kerrisk 5219daec26 unix.7: One must send at least one byte of real data with ancillary data
When sending ancillary data, at least one byte of real data should
also be sent.  This is strictly necessary for stream sockets
(verified by experiment). It is not required for datagram sockets
on Linux (verified by experiment), but portable applications
should do so.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-15 10:33:42 +02:00
Michael Kerrisk c0e56ed687 unix.7: Clarify treatment of incoming ancillary data if 'msg_control' is NULL
If no buffer is supplied for incoming ancillary data, then
the data is lost.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-15 10:33:32 +02:00
Michael Kerrisk 4564dd1fee unix.7: If the buffer to receive SCM_RIGHTS FDs is too small, FDs are closed
If the ancillary data buffer for receiving SCM_RIGHTS file
descriptors is too small, then the excess file descriptors are
automatically closed in the receiving process. Verified by
experiment.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-15 10:16:49 +02:00
Michael Kerrisk b65f4c691d unix.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-15 10:16:49 +02:00
Michael Kerrisk 879962006f unix.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-15 09:50:30 +02:00
Michael Kerrisk ba9fc3e1b2 send.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-15 08:59:08 +02:00
Michael Kerrisk 418dd92c03 recv.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-15 08:58:37 +02:00
Michael Kerrisk 3ef2a133bf mount.2: Mention /proc/PID/mountinfo
Many people are unaware of the /proc/PID/mountinfo file. Provide
a helpful clue here.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-13 07:14:33 +02:00
Michael Kerrisk 93f5b0f8f4 mount_namespaces.7: SEE ALSO: add findmnt(8)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-13 07:08:28 +02:00