Patches from others
cover Patches from others
Hello Michael,
These are the patches that I have merged from others.
Cheers,
Alex
---
Akihiro Motoki (4):
move_pages.2: ffix
semctl.2: ffix
fanotify.7: ffix
signalfd.2: tfix
Alejandro Colomar (3):
setbuf.3: tfix
sigwaitinfo.2: tfix
getopt.3: Minor tweaks to James' patch
Aurelien Aptel (1):
flock.2: add CIFS details
Borislav Petkov (1):
sigaltstack.2: tfix
Dmitry V. Levin (2):
move_pages.2: ffix
ptrace.2: mention PTRACE_GET_SYSCALL_INFO in RETURN VALUE section
Jakub Wilk (2):
Changes.old: tfix
exit_group.2, getunwind.2: tfix
James O. D. Hunt (1):
getopt.3: Clarify behaviour
Johannes Berg (1):
clone.2: tfix
Vishwajith K (1):
shmop.2: tfix
Štěpán Němec (1):
execve.2: tfix
Changes.old | 6 +++--- man2/clone.2 | 2 +- man2/execve.2 | 2 +- man2/exit_group.2 | 2 +- man2/flock.2 | 25 +++++++++++++++++++++++++ man2/getunwind.2 | 2 +- man2/move_pages.2 | 3 ++- man2/ptrace.2 | 7 +++++-- man2/semctl.2 | 2 +- man2/shmop.2 | 4 ++-- man2/sigaltstack.2 | 2 +- man2/signalfd.2 | 2 +- man2/sigwaitinfo.2 | 2 +- man3/getopt.3 | 23 +++++++++++++++++++++++ man3/setbuf.3 | 2 +- man7/fanotify.7 | 2 +- 16 files changed, 70 insertions(+), 18 deletions(-)
Signature · 1 line
2.31.1
PATCH 1/17 flock.2: add CIFS details
From: Aurelien Aptel <[email protected]>
CIFS flock() locks behave differently than the standard. Give overview of those differences.
Here is the rendered text:
CIFS details
In Linux kernels up to 5.4, flock() is not propagated over SMB. A file with such locks will not appear locked for remote clients.
Since Linux 5.5, flock() locks are emulated with SMB byte-range locks
on the entire file. Similarly to NFS, this means that fcntl(2) and
flock() locks interact with one another. Another important side-effect is that the locks are not advisory anymore: any IO on a locked file will always fail with EACCES when done from a separate file descriptor. This difference originates from the design of locks in the SMB proto- col, which provides mandatory locking semantics.
Remote and mandatory locking semantics may vary with SMB protocol, mount options and server type. See mount.cifs(8) for additional infor- mation.
Discussion: linux-man <https://lore.kernel.org/linux-man/[email protected]/>
--- man2/flock.2 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
man2/flock.2 +25 -0
@@ -239,6 +239,31 @@ see the discussion of the .I "local_lock" option in .BR nfs (5). +.SS CIFS details +In Linux kernels up to 5.4, +.BR flock () +is not propagated over SMB. +A file with such locks will not appear locked for remote clients. +.PP +Since Linux 5.5, +.BR flock () +locks are emulated with SMB byte-range locks on the entire file. +Similarly to NFS, this means that +.BR fcntl (2) +and +.BR flock () +locks interact with one another. +Another important side-effect is that the locks are not advisory anymore: +any IO on a locked file will always fail with +.BR EACCES +when done from a separate file descriptor. +This difference originates from the design of locks in the SMB protocol, +which provides mandatory locking semantics. +.PP +Remote and mandatory locking semantics may vary with SMB protocol, mount options and server type. +See +.BR mount.cifs (8) +for additional information. .SH SEE ALSO .BR flock (1), .BR close (2),
Signature · 1 line
2.31.1
PATCH 2/17 sigaltstack.2: tfix
In reply to Alejandro ColomarFrom: Borislav Petkov <[email protected]>
Add a missing "to" in an "in order to" formulation.
--- man2/sigaltstack.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man2/sigaltstack.2 +1 -1
@@ -111,7 +111,7 @@ Clear the alternate signal stack settings on entry to the signal handler. When the signal handler returns, the previous alternate signal stack settings are restored. .IP -This flag was added in order make it safe +This flag was added in order to make it safe to switch away from the signal handler with .BR swapcontext (3). Without this flag, a subsequently handled signal will corrupt
Signature · 1 line
2.31.1
PATCH 3/17 setbuf.3: tfix
In reply to Alejandro Colomar--- man3/setbuf.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man3/setbuf.3 +1 -1
@@ -229,7 +229,7 @@ int main(void) { char buf[BUFSIZ]; - setbuf(stdin, buf); + setbuf(stdout, buf); printf("Hello, world!\en"); return 0; }
Signature · 1 line
2.31.1
PATCH 4/17 clone.2: tfix
In reply to Alejandro ColomarFrom: Johannes Berg <[email protected]>
Despite my mention of this spawning a hilarious discussion on IRC, this alignment restriction should be 128-bit, not 126-bit.
--- man2/clone.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man2/clone.2 +1 -1
@@ -1418,7 +1418,7 @@ was an invalid. .TP .BR EINVAL " (AArch64 only, Linux 4.6 and earlier)" .I stack -was not aligned to a 126-bit boundary. +was not aligned to a 128-bit boundary. .TP .B ENOMEM Cannot allocate sufficient memory to allocate a task structure for the
Signature · 1 line
2.31.1
PATCH 5/17 move_pages.2: ffix
In reply to Alejandro ColomarFrom: "Dmitry V. Levin" <[email protected]>
--- man2/move_pages.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man2/move_pages.2 +1 -1
@@ -24,7 +24,7 @@ move_pages \- move individual pages of a process to another node .nf .B #include <numaif.h> .PP -.BI "long move_pages(int " pid ", unsigned long count, void **" pages , +.BI "long move_pages(int " pid ", unsigned long " count ", void **" pages , .BI " const int *" nodes ", int *" status ", int " flags ); .fi .PP
Signature · 1 line
2.31.1
PATCH 6/17 ptrace.2: mention PTRACE_GET_SYSCALL_INFO in RETURN VALUE section
In reply to Alejandro ColomarFrom: "Dmitry V. Levin" <[email protected]>
Mirror the wording about PTRACE_GET_SYSCALL_INFO return value semantics from "DESCRIPTION" section to "RETURN VALUE" section.
Complements: fc91449cb "ptrace.2: Document PTRACE_GET_SYSCALL_INFO"
--- man2/ptrace.2 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
man2/ptrace.2 +5 -2
@@ -2327,8 +2327,11 @@ On success, the requests return the requested data (but see NOTES), the .B PTRACE_SECCOMP_GET_FILTER -request returns the number of instructions in the BPF program, and -other requests return zero. +request returns the number of instructions in the BPF program, +the +.B PTRACE_GET_SYSCALL_INFO +request returns the number of bytes available to be written by the kernel, +and other requests return zero. .PP On error, all requests return \-1, and .I errno
Signature · 1 line
2.31.1
PATCH 7/17 Changes.old: tfix
In reply to Alejandro ColomarFrom: Jakub Wilk <[email protected]>
--- Changes.old | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Changes.old +3 -3
@@ -53581,7 +53581,7 @@ Various pages Generally, place '||' at start of a line, rather than the end of the previous line. - Rationale: this placement clearly indicates that that each piece + Rationale: this placement clearly indicates that each piece is an alternative. Various pages
@@ -54119,7 +54119,7 @@ system.3 environ.7 Bastien Roucariès Reorder the text - Move the the text describing how to set environment variable before + Move the text describing how to set environment variable before the list(s) of variables in order to improve readability. Bastien Roucariès Document convention of string in environ
@@ -54152,7 +54152,7 @@ man-pages.7 Michael Kerrisk Add a FORMATTING AND WORDING CONVENTIONS section In man-pages-5.11, a large number of pages were edited to achieve - greater consistency in the SYNOPIS, RETURN VALUE and ATTRIBUTES + greater consistency in the SYNOPSIS, RETURN VALUE and ATTRIBUTES sections. To avoid future inconsistencies, try to capture some of the preferred conventions in text in man-pages(7). Michael Kerrisk
Signature · 1 line
2.31.1
PATCH 8/17 exit_group.2, getunwind.2: tfix
In reply to Alejandro ColomarFrom: Jakub Wilk <[email protected]>
--- man2/exit_group.2 | 2 +- man2/getunwind.2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
man2/exit_group.2 +1 -1
@@ -28,7 +28,7 @@ exit_group \- exit all threads in a process .SH SYNOPSIS .nf .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" -.B #inlcude <unistd.h> +.B #include <unistd.h> .PP .BI "noreturn void syscall(SYS_exit_group, int " status ); .fi
man2/getunwind.2 +1 -1
@@ -31,7 +31,7 @@ getunwind \- copy the unwind data to caller's buffer .nf .B #include <linux/unwind.h> .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" -.B #inlcude <unistd.h> +.B #include <unistd.h> .PP .BI "long syscall(SYS_getunwind, void " *buf ", size_t " buf_size ); .fi
Signature · 1 line
2.31.1
PATCH 9/17 sigwaitinfo.2: tfix
In reply to Alejandro ColomarFix wording issue introduced in commitbf1298c9e5053f55dea43e74255dae5ec57f251e.
--- man2/sigwaitinfo.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man2/sigwaitinfo.2 +1 -1
@@ -120,7 +120,7 @@ set to indicate the error. .B EAGAIN No signal in .I set -was became pending within the +became pending within the .I timeout period specified to .BR sigtimedwait ().
Signature · 1 line
2.31.1
PATCH 10/17 getopt.3: Clarify behaviour
In reply to Alejandro ColomarFrom: "James O. D. Hunt" <[email protected]>
Improved the getopt(3) man page in the following ways:
1) Defined the existing term "legitimate option character".
2) Added an additional NOTE stressing that arguments are parsed in strict order and the implications of this when numeric options are utilised.
--- man3/getopt.3 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
man3/getopt.3 +23 -0
@@ -126,6 +126,11 @@ Then \fIoptind\fP is the index in \fIargv\fP of the first .PP .I optstring is a string containing the legitimate option characters. +A legitimate option character is any visible one byte +.BR ascii (7) +character (for which +.BR isgraph (3) +would return nonzero) that is not dash (\(aq\-\(aq) or colon (\(aq:\(aq). If such a character is followed by a colon, the option requires an argument, so .BR getopt ()
@@ -402,6 +407,24 @@ routine that rechecks .B POSIXLY_CORRECT and checks for GNU extensions in .IR optstring .) +.PP +Command-line arguments are parsed in strict order +meaning that an option requiring an argument will consume the next argument, +regardless of whether that argument is the correctly specified option argument +or simply the next option +(in the scenario the user mis-specifies the command line). +For example, if +.I optstring +is specified as "1n:" +and the user specifies the command line arguments incorrectly as +.IR "prog\ \-n\ \-1" , +the +.I \-n +option will be given the +.B optarg +value "\-1", and the +.I \-1 +option will be considered to have not been specified. .SH EXAMPLES .SS getopt() The following trivial example program uses
Signature · 1 line
2.31.1
PATCH 11/17 getopt.3: Minor tweaks to James' patch
In reply to Alejandro ColomarThe rest of the page writes the characters without naming them. Follow that convention.
--- man3/getopt.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man3/getopt.3 +1 -1
@@ -130,7 +130,7 @@ A legitimate option character is any visible one byte .BR ascii (7) character (for which .BR isgraph (3) -would return nonzero) that is not dash (\(aq\-\(aq) or colon (\(aq:\(aq). +would return nonzero) that is not \(aq\-\(aq or \(aq:\(aq. If such a character is followed by a colon, the option requires an argument, so .BR getopt ()
Signature · 1 line
2.31.1
PATCH 12/17 shmop.2: tfix
In reply to Alejandro ColomarFrom: Vishwajith K <[email protected]>
--- man2/shmop.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
man2/shmop.2 +2 -2
@@ -387,8 +387,8 @@ main(int argc, char *argv[]) errExit("shmget"); semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600); - if (shmid == \-1) - errExit("shmget"); + if (semid == \-1) + errExit("semget"); /* Attach shared memory into our address space. */
Signature · 1 line
2.31.1
PATCH 13/17 execve.2: tfix
In reply to Alejandro ColomarFrom: Štěpán Němec <[email protected]>
--- man2/execve.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man2/execve.2 +1 -1
@@ -141,7 +141,7 @@ similarly, the effective group ID is copied to the saved set-group-ID. This copying takes place after any effective ID changes that occur because of the set-user-ID and set-group-ID mode bits. .PP -The process's real UID and real GID, as well its supplementary group IDs, +The process's real UID and real GID, as well as its supplementary group IDs, are unchanged by a call to .BR execve (). .PP
Signature · 1 line
2.31.1
PATCH 14/17 move_pages.2: ffix
In reply to Alejandro ColomarFrom: Akihiro Motoki <[email protected]>
--- man2/move_pages.2 | 1 + 1 file changed, 1 insertion(+)
man2/move_pages.2 +1 -0
@@ -180,6 +180,7 @@ The number of nonmigrated pages if they were the result of nonfatal reasons (since .\" commit a49bd4d7163707de377aee062f17befef6da891b Linux 4.17). +.TP .B E2BIG Too many pages to move. Since Linux 2.6.29,
Signature · 1 line
2.31.1
PATCH 15/17 semctl.2: ffix
In reply to Alejandro ColomarFrom: Akihiro Motoki <[email protected]>
--- man2/semctl.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man2/semctl.2 +1 -1
@@ -377,7 +377,7 @@ the semaphore set. .TP .B SETVAL Set the semaphore value -.BR ( semval ) +.RB ( semval ) to .I arg.val for the
Signature · 1 line
2.31.1
PATCH 16/17 fanotify.7: ffix
In reply to Alejandro ColomarFrom: Akihiro Motoki <[email protected]>
--- man7/fanotify.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man7/fanotify.7 +1 -1
@@ -147,7 +147,7 @@ influences what data structures are returned to the event listener for each event. Events reported to a group initialized with one of these flags will use file handles to identify filesystem objects instead of file descriptors. -.TP +.PP After a successful .BR read (2), the read buffer contains one or more of the following structures:
Signature · 1 line
2.31.1
PATCH 17/17 signalfd.2: tfix
In reply to Alejandro ColomarFrom: Akihiro Motoki <[email protected]>
--- man2/signalfd.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man2/signalfd.2 +1 -1
@@ -196,7 +196,7 @@ struct signalfd_siginfo { uint64_t ssi_addr; /* Address that generated signal (for hardware\-generated signals) */ uint16_t ssi_addr_lsb; /* Least significant bit of address - (SIGBUS; since Linux 2.6.37) + (SIGBUS; since Linux 2.6.37) */ .\" ssi_addr_lsb: commit b8aeec34175fc8fe8b0d40efea4846dfc1ba663e uint8_t pad[\fIX\fP]; /* Pad size to 128 bytes (allow for additional fields in the future) */
Signature · 1 line
2.31.1
Hello Alex,
Quoted 8 lines · Alejandro Colomar
Hello Michael,
These are the patches that I have merged from others.
Cheers,
Alex
These all look good, and I've applied them all.
Thank you for accumulating these in my absence!
Cheers,
Michael
Quoted 57 lines
---
Akihiro Motoki (4):
move_pages.2: ffix
semctl.2: ffix
fanotify.7: ffix
signalfd.2: tfixAlejandro Colomar (3):
setbuf.3: tfix
sigwaitinfo.2: tfix
getopt.3: Minor tweaks to James' patchAurelien Aptel (1):
flock.2: add CIFS detailsBorislav Petkov (1):
sigaltstack.2: tfixDmitry V. Levin (2):
move_pages.2: ffix
ptrace.2: mentionPTRACE_GET_SYSCALL_INFOin RETURN VALUE sectionJakub Wilk (2):
Changes.old: tfix
exit_group.2, getunwind.2: tfixJames O. D. Hunt (1):
getopt.3: Clarify behaviourJohannes Berg (1):
clone.2: tfixVishwajith K (1):
shmop.2: tfixŠtěpán Němec (1):
execve.2: tfixChanges.old | 6 +++--- man2/clone.2 | 2 +- man2/execve.2 | 2 +- man2/exit_group.2 | 2 +- man2/flock.2 | 25 +++++++++++++++++++++++++ man2/getunwind.2 | 2 +- man2/move_pages.2 | 3 ++- man2/ptrace.2 | 7 +++++-- man2/semctl.2 | 2 +- man2/shmop.2 | 4 ++-- man2/sigaltstack.2 | 2 +- man2/signalfd.2 | 2 +- man2/sigwaitinfo.2 | 2 +- man3/getopt.3 | 23 +++++++++++++++++++++++ man3/setbuf.3 | 2 +- man7/fanotify.7 | 2 +- 16 files changed, 70 insertions(+), 18 deletions(-)
Signature · 3 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/