Re: [PATCH 2/2] seccomp.2: document userspace notification

2019-03-01 Thread Michael Kerrisk (man-pages)
On 3/1/19 4:19 PM, Tycho Andersen wrote: > On Fri, Mar 01, 2019 at 04:16:27PM +0100, Michael Kerrisk (man-pages) wrote: >> Hello Tycho, >> >> On 3/1/19 3:53 PM, Tycho Andersen wrote: >>> On Thu, Feb 28, 2019 at 01:52:19PM +0100, Michael Kerrisk (man-pages) wrote: >

Re: [PATCH] ptrace.2: Improve clarity for multi-threaded tracers

2019-02-25 Thread Michael Kerrisk (man-pages)
uot; or "tracee" always mean "(one) thread", > > never "a (possibly multithreaded) process". > > Ptrace commands are always sent to > > a specific tracee using a call of the form > > @@ -2259,7 +2265,7 @@ or (on kernels before 2.6.26) be > > .TP > > .B ESRCH > > The specified process does not exist, or is not currently being traced > > -by the caller, or is not stopped > > +by the calling thread, or is not stopped > > (for requests that require a stopped tracee). > > .SH CONFORMING TO > > SVr4, 4.3BSD. > > I agree the current text can be made more clear on the subject, > but, unfortunately, proposed change makes the description more confusing. > > > -- > ldv -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH v3 1/1] process_madvise.2: Add process_madvise man page

2021-02-13 Thread Michael Kerrisk (man-pages)
Hello Suren, On 2/2/21 11:12 PM, Suren Baghdasaryan wrote: > Hi Michael, > > On Tue, Feb 2, 2021 at 2:45 AM Michael Kerrisk (man-pages) > wrote: >> >> Hello Suren (and Minchan and Michal) >> >> Thank you for the revisions! >> >> I've applie

Re: [PATCH v3 1/1] process_madvise.2: Add process_madvise man page

2021-02-18 Thread Michael Kerrisk (man-pages)
de a wrapper for this system call; call it us‐ ing syscall(2). SEE ALSO madvise(2), pidfd_open(2), process_vm_readv(2), process_vm_write(2) -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Tr

Re: [RFC] execve.2: SYNOPSIS: Document both glibc wrapper and kernel sycalls

2021-02-18 Thread Michael Kerrisk (man-pages)
Glibc wrapper function: */ > .B #include > .PP > -.BI "int execve(const char *" pathname ", char *const " argv [], > -.BI " char *const " envp []); > +.BI "int execve(const char *" pathname ", > +.BI " char

Re: [RFC v2] execve.2: SYNOPSIS: Document both glibc wrapper and kernel sycalls

2021-02-19 Thread Michael Kerrisk (man-pages)
membarrier(int " cmd ", int " flags ); > +.BI "int syscall(SYS_membarrier, int " cmd ", int " flags ); > .EE > .in > .SH CONFORMING TO > @@ -322,9 +321,6 @@ Examples where > .BR membarrier () > can be useful include implementations > of Read-Copy-Update libraries and garbage collectors. > -.PP > -Glibc does not provide a wrapper for this system call; call it using > -.BR syscall (2). > .SH EXAMPLES > Assuming a multithreaded application where "fast_path()" is executed > very frequently, and where "slow_path()" is executed infrequently, the > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH 1/1] process_madvise.2: Add process_madvise man page

2021-01-28 Thread Michael Kerrisk (man-pages)
Hello Suren, On 1/28/21 7:40 PM, Suren Baghdasaryan wrote: > On Thu, Jan 28, 2021 at 4:24 AM Michael Kerrisk (man-pages) > wrote: >> >> Hello Suren, >> >> Thank you for writing this page! Some comments below. > > Thanks for the review! > Couple question

Re: [PATCH v6] close_range.2: new page documenting close_range(2)

2021-01-28 Thread Michael Kerrisk (man-pages)
se the limit on the number of open file descriptors has been reached? I mean: no new FDs are being opened, so how can we go over the limit. I think the cause of this error is something else, but what is it? Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc

Re: [PATCH v2 1/1] process_madvise.2: Add process_madvise man page

2021-01-30 Thread Michael Kerrisk (man-pages)
en Baghdasaryan > --- > changes in v2: > - Changed description of MADV_COLD per Michal Hocko's suggestion > - Appled fixes suggested by Michael Kerrisk > > NAME > process_madvise - give advice about use of memory to a process s/-/\-/ > &g

Re: [PATCH v3 1/1] process_madvise.2: Add process_madvise man page

2021-02-02 Thread Michael Kerrisk (man-pages)
> changes in v2: > - Changed description of MADV_COLD per Michal Hocko's suggestion > - Applied fixes suggested by Michael Kerrisk > changes in v3: > - Added Michal's Reviewed-by > - Applied additional fixes suggested by Michael Kerrisk > > NAME > process_ma

Re: [PATCH v2] ipc.2: Fix prototype parameter types

2021-02-09 Thread Michael Kerrisk (man-pages)
an2/ipc.2 > index 6589ffae6..a36e895a2 100644 > --- a/man2/ipc.2 > +++ b/man2/ipc.2 > @@ -27,9 +27,8 @@ > ipc \- System V IPC system calls > .SH SYNOPSIS > .nf > -.BI "int ipc(unsigned int " call ", int " first ", int " second \ > -"

Re: [PATCH v2] clone.2: Document CLONE_INTO_CGROUP

2020-05-19 Thread Michael Kerrisk (man-pages)
Hello Christian, Thanks for this patch! On 5/18/20 7:55 PM, Christian Brauner wrote: > From: Christian Brauner > > Signed-off-by: Christian Brauner > --- > /* v2 */ > - Michael Kerrisk (man-pages) : > - Fix various types and add examples and how to specify the

Re: [PATCH v2] clone.2: Document CLONE_INTO_CGROUP

2020-05-19 Thread Michael Kerrisk (man-pages)
On 5/19/20 3:51 PM, Christian Brauner wrote: > On Tue, May 19, 2020 at 03:36:28PM +0200, Michael Kerrisk (man-pages) wrote: >> On 5/18/20 7:55 PM, Christian Brauner wrote: >>> From: Christian Brauner >>> + >>> +Spawning a process into a cgroup different fr

Re: [PATCH] selftests/socket: Introduce simple SCM_RIGHTS tests

2020-08-11 Thread Michael Kerrisk (man-pages)
t; a test script and wire it up to the selftests. > > Signed-off-by: Kees Cook Acked-by: Michael Kerrisk (As per off-list discussion with Kees), I confirm that I'm okay with relicensing to GPL2+. Cheers, Michael > --- > FYI, this also relicenses Michael's code (with his pe

Re: Mount API manual pages

2020-08-03 Thread Michael Kerrisk (man-pages)
On Fri, 24 Jul 2020 at 12:45, David Howells wrote: > > Michael Kerrisk (man-pages) wrote: > > > Would you be willing to do the following please: > > > > 1. Review the pages that you already wrote to see what needs to be > > updated. (I did take a look at some

Re: [patch] close_range.2: new page documenting close_range(2)

2020-12-10 Thread Michael Kerrisk (man-pages)
.BR close_range () >>> +can take care of this without requiring >>> +.B /proc > > By reading proc.5, I think this should s/.B/.I/, right mtk? Yes to both. Pathnames are formatted with .I. -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH v2] close_range.2: new page documenting close_range(2)

2020-12-10 Thread Michael Kerrisk (man-pages)
-git a/man2/close_range.2 b/man2/close_range.2 >> new file mode 100644 >> index 0..403142b33 >> --- /dev/null >> +++ b/man2/close_range.2 [...] >> +.SH USE CASES > > This section is unconventional. Please move that text to one of the > traditional

man-pages-5.10 is released

2020-12-22 Thread Michael Kerrisk (man-pages)
Changes in man-pages-5.10 Newly documented interfaces in existing pages - access.2 Michael Kerrisk Document faccessat2() faccessat2() was added in Linux 5.8 and enables a fix to

Re: [PATCH v5] close_range.2: new page documenting close_range(2)

2020-12-22 Thread Michael Kerrisk (man-pages)
: %s ...\en", argv[0]); > +exit(EXIT_FAILURE); > +} > + > +for (int i = 2; i < argc; i++) { > +if (open(argv[i], O_RDONLY) == -1) { > +perror(argv[i]); > +exit(EXIT_FAILURE); > +} > +} > + > +if (syscall(__NR_close_range, 3, ~0U, CLOSE_RANGE_UNSHARE) == -1) { Line too long. Alternatively, what about s/CLOSE_RANGE_UNSHARE/0/? Or it considered best practice to always use CLOSE_RANGE_UNSHARE? > +perror("close_range"); > +exit(EXIT_FAILURE); > +} > + > +execve(argv[1], newargv, newenviron); > +perror("execve"); > +exit(EXIT_FAILURE); > +} > +.EE > +.in > +.PP > +We can use the second program to exec the first as follows: > +.PP > +.in +4n > +.EX > +.RB "$" " make listopen close_range" Perhaps we don't really need the preceding line? > +.RB "$" " ./close_range ./listopen /dev/null /dev/zero" > +FD 0 is open. > +FD 1 is open. > +FD 2 is open. > +.EE > +.in > +.PP > +Removing the call to > +.BR close_range () > +will show different output, > +with the file descriptors for the named files still open. > +.SH SEE ALSO > +.BR close (2) > > base-commit: b5dae3959625f5ff378e9edf9139057d1c06bb55 Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH v6] close_range.2: new page documenting close_range(2)

2021-03-21 Thread Michael Kerrisk (man-pages)
Hello Stephen and Christian, Late follow-up, I'm afraid... On 1/29/21 11:00 AM, Christian Brauner wrote: > On Thu, Jan 28, 2021 at 11:10:40PM +0100, Stephen Kitt wrote: >> Hello Michael, >> >> On Thu, 28 Jan 2021 21:50:23 +0100, "Michael Kerrisk (man-pages)"

Re: [PATCH v6] close_range.2: new page documenting close_range(2)

2021-03-21 Thread Michael Kerrisk (man-pages)
On 3/9/21 8:53 PM, Stephen Kitt wrote: > Hi Michael, > > On Thu, 28 Jan 2021 21:50:23 +0100, "Michael Kerrisk (man-pages)" > wrote: >> Thanks for your patch revision. I've merged it, and have >> done some light editing, but I still have a question: > &

man-pages-5.11 released

2021-03-22 Thread Michael Kerrisk (man-pages)
below. Cheers, Michael Changes in man-pages-5.11 Released: 2021-03-21, Munich New and rewritten pages --- close_range.2 Stephen Kitt, Michael Kerrisk [Christian Brauner] New page documenting close_range(2) process_madvise

Re: [PATCH v5 0/4] man2: udpate mm/userfaultfd manpages to latest

2021-04-05 Thread Michael Kerrisk (man-pages)
ng patches from others? Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [patch] close_range.2: new page documenting close_range(2)

2020-12-09 Thread Michael Kerrisk (man-pages)
take a guess */ for (fd = 0; fd < maxfd; fd++) close(fd); I think it's fine to mention the use of a /proc as an (inferior and) alternative way of doing this. I'm just not sure that "commonly" is correct. > +descriptors in > +.B /proc/self/fd/ > +and calling > +.BR close (2) > +on each one. > +.BR close_range () > +can take care of this without requiring > +.B /proc > +and with a single system call, which provides significant performance > +benefits. > +.SH SEE ALSO > +.BR close (2) > > base-commit: b5dae3959625f5ff378e9edf9139057d1c06bb55 > -- > 2.20.1 Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: set_thread_area.2: csky architecture undocumented

2020-11-23 Thread Michael Kerrisk (man-pages)
gt; - #elif defined __mips__ > + #elif defined(__mips__ || __csky__) > > and then change the rest of the text to add csky when appropriate. > Am I correct? As far as I can tell, you are correct. Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH] restart_syscall.2: SYNOPSIS: Fix restart_syscall() return type

2020-11-23 Thread Michael Kerrisk (man-pages)
tart_syscall \- restart a system call after interruption by a stop signal > .SH SYNOPSIS > -.B int restart_syscall(void); > +.B long restart_syscall(void); > .PP > .IR Note : > There is no glibc wrapper for this system call; see NOTES. > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH] set_tid_address.2: SYNOPSIS: Fix set_tid_address() return type

2020-11-24 Thread Michael Kerrisk (man-pages)
d8..b18b8efef 100644 > --- a/man2/set_tid_address.2 > +++ b/man2/set_tid_address.2 > @@ -29,7 +29,7 @@ set_tid_address \- set pointer to thread ID > .nf > .B #include > .PP > -.BI "long set_tid_address(int *" tidptr ); > +.BI "pid_t set_tid_address(int *"

Re: set_thread_area.2: csky architecture undocumented

2020-11-24 Thread Michael Kerrisk (man-pages)
- #elif defined __mips__ > + #elif defined(__mips__ || __csky__) > > and then change the rest of the text to add csky when appropriate. > Am I correct? AFAICT, you are correct. I think the reason that csky is missing is that the architecture was added after this manual p

Linux man-pages maintainership adjustments

2020-12-05 Thread Michael Kerrisk (man-pages)
one day I will return to being just a contributor and no longer the maintainer. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH] entry: Use different define for selector variable in SUD

2021-01-20 Thread Michael Kerrisk (man-pages)
Hello all, On Sat, 2 Jan 2021 at 00:55, Gabriel Krisman Bertazi wrote: > > Michael Kerrisk suggested that, from an API perspective, it is a bad > idea to share the PR_SYS_DISPATCH_ defines between the prctl operation > and the selector variable. Therefore, define two new constants

Re: [PATCH v27 12/12] landlock: Add user and kernel documentation

2021-01-22 Thread Michael Kerrisk (man-pages)
+/proc/self/ns/, cannot currently be restricted. For now, these kind of > special > +paths are then always allowed. Future Landlock evolutions will enable to > +restrict such paths with dedicated ruleset flags. > + > +Questions and answers > += > + > +Wh

Re: [PATCH 1/5] Add manpage for open_tree(2)

2021-01-22 Thread Michael Kerrisk (man-pages)
Hello David, Ping! Thanks, Michael On Thu, 27 Aug 2020 at 13:01, Michael Kerrisk (man-pages) wrote: > > Hello David, > > Can I ask that you please reply to each of my mails, rather than > just sending out a new patch series (which of course I would also > like you to do).

Re: [PATCH 2/5] Add manpages for move_mount(2)

2021-01-22 Thread Michael Kerrisk (man-pages)
P > +This would move the object mounted on "/a" to "/b". It can also be used in > +conjunction with > +.BR open_tree "(2) or " open "(2) with " O_PATH : > +.PP > +.RS > +.nf > +fd = open_tree(AT_FDCWD, "/mnt", 0); > +move_mount(fd, "", AT_FDCWD, "/mnt2", MOVE_MOUNT_F_EMPTY_PATH); > +move_mount(fd, "", AT_FDCWD, "/mnt3", MOVE_MOUNT_F_EMPTY_PATH); > +move_mount(fd, "", AT_FDCWD, "/mnt4", MOVE_MOUNT_F_EMPTY_PATH); > +.fi > +.RE > +.PP > +This would attach the path point for "/mnt" to fd, then it would move the > +mount to "/mnt2", then move it to "/mnt3" and finally to "/mnt4". > +.PP > +It can also be used to attach new mounts: > +.PP > +.RS > +.nf > +sfd = fsopen("ext4", FSOPEN_CLOEXEC); > +fsconfig(sfd, FSCONFIG_SET_STRING, "source", "/dev/sda1", 0); > +fsconfig(sfd, FSCONFIG_SET_FLAG, "user_xattr", NULL, 0); > +fsconfig(sfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0); > +mfd = fsmount(sfd, FSMOUNT_CLOEXEC, MOUNT_ATTR_NODEV); > +move_mount(mfd, "", AT_FDCWD, "/home", MOVE_MOUNT_F_EMPTY_PATH); > +.fi > +.RE > +.PP > +Which would open the Ext4 filesystem mounted on "/dev/sda1", turn on user > +extended attribute support and create a mount object for it. Finally, the > new > +mount object would be attached with > +.BR move_mount () > +to "/home". > +.SH SEE ALSO > +.BR fsmount (2), > +.BR fsopen (2), > +.BR open_tree (2) > > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH 4/5] Add manpage for fsopen(2) and fsmount(2)

2021-01-22 Thread Michael Kerrisk (man-pages)
Hello David, Ping! Thanks, Michael On Fri, 16 Oct 2020 at 08:50, Michael Kerrisk (man-pages) wrote: > > Hi David, > > Another ping for these five patches please! > > Cheers, > > Michael > > On Fri, 11 Sep 2020 at 14:44, Michael Kerrisk (man-pages) > wrote:

Re: [PATCH 3/5] Add manpage for fspick(2)

2021-01-22 Thread Michael Kerrisk (man-pages)
privileges. > +.SH CONFORMING TO > +These functions are Linux-specific and should not be used in programs > intended > +to be portable. > +.SH VERSIONS > +.BR fsopen "(), " fsmount "() and " fspick () > +were added to Linux in kernel 5.2. > +.SH EXAMPLES > +To illustrate the process, here's an example whereby this can be used to > +reconfigure a filesystem: > +.PP > +.in +4n > +.nf > +sfd = fspick(AT_FDCWD, "/mnt", FSPICK_NO_AUTOMOUNT | FSPICK_CLOEXEC); > +fsconfig(sfd, FSCONFIG_SET_FLAG, "ro", NULL, 0); > +fsconfig(sfd, FSCONFIG_SET_STRING, "user_xattr", "false", 0); > +fsconfig(sfd, FSCONFIG_CMD_RECONFIGURE, NULL, NULL, 0); > +.fi > +.in > +.PP > +.SH NOTES > +Glibc does not (yet) provide a wrapper for the > +.BR fspick "()" > +system call; call it using > +.BR syscall (2). > +.SH SEE ALSO > +.BR mountpoint (1), > +.BR fsconfig (2), > +.BR fsopen (2), > +.BR path_resolution (7), > +.BR mount (8) > > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH 5/5] Add manpage for fsconfig(2)

2021-01-22 Thread Michael Kerrisk (man-pages)
er to a filesystem configuration context. > +.TP > +.B EINVAL > +One of the source parameters referred to an invalid superblock. > +.TP > +.B ELOOP > +Too many links encountered during pathname resolution. > +.TP > +.B ENAMETOOLONG > +A path name was longer than > +.BR

Re: [PATCH] getcpu.2: Document glibc wrapper instead of kernel syscall

2021-01-02 Thread Michael Kerrisk (man-pages)
.\" x86: ignore the sys_getcpu() tcache parameter -In earlier kernels, -if this argument was non-NULL, +In Linux 2.6.23 and earlier, if the +.I tcache +argument was non-NULL, then it specified a pointer to a caller-allocated buffer in thread-local storage that was used to provide a cachi

Re: [PATCH 1/1] process_madvise.2: Add process_madvise man page

2021-01-28 Thread Michael Kerrisk (man-pages)
d by > +.I iovec > +is outside the accessible address space of the process pid. s/process pid./ the process referred to by .IR pidfd . / > +.TP > +.B EINVAL > +.I flags > +is not 0. > +.TP > +.B EINVAL > +The sum of the > +.I iov_len > +values of > +.I iovec > +overflows a ssize_t value. .I ssize_t > +.TP > +.B EINVAL > +.I vlen > +is too large. > +.TP > +.B ENOMEM > +Could not allocate memory for internal copies of the > +.I iovec > +structures. > +.TP > +.B EPERM > +The caller does not have permission to access the address space of the > process > +.I pidfd. .IR pidfd . > +.TP > +.B ESRCH > +No process with ID > +.I pidfd > +exists. Should this maybe be: [[ The target process does not exist (i.e., it has terminated and been waited on). ]] See pidfd_send_signal(2). Also, is an EBADF error possible? Again, see pidfd_send_signal(2). > +.SH VERSIONS > +Since Linux 5.10, Better: This system call first appeared in Linux 5.10. > +.\" commit ecb8ac8b1f146915aa6b96449b66dd48984caacc > +support for this system call is optional, s/support/Support/ > +depending on the setting of the > +.B CONFIG_ADVISE_SYSCALLS > +configuration option. > +.SH SEE ALSO > +.BR madvise (2), > +.BR pidofd_open(2), > +.BR process_vm_readv (2), > +.BR process_vm_write (2) Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH v2 2/4] x86/elf: Support a new ELF aux vector AT_MINSIGSTKSZ

2020-11-27 Thread Michael Kerrisk (man-pages)
ough reason to document it. > > Adding Michael. Commit 94b07c1f8c39 was your, Dave. Might I convince you to write a patch for getauxval(3)? Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH] spu_create.2: Clarify that one of the prototypes is the current one

2020-11-27 Thread Michael Kerrisk (man-pages)
, mode_t " mode "," .BI " int " neighbor_fd ");" .fi @@ -89,6 +88,12 @@ for a full list of the possible values. .PP The +.I neighbor_fd +is used only when the +.B SPU_CREATE_AFFINITY_SPU +flag is specified; see below. +.PP +The .I flags argument can be zero or any bitwise OR-ed combination of the following constants: @@ -264,6 +269,14 @@ See .UR http://www.bsc.es\:/projects\:/deepcomputing\:/linuxoncell/ .UE for the recommended libraries. +.PP +Prior to the addition of the +.B SPU_CREATE_AFFINITY_SPU +flag in Linux 2.6.23, the +.BR spu_create () +system call took only three arguments (i.e., there was no +.I neighbor_fd +argument). .SH EXAMPLES See .BR spu_run (2) -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: [PATCH] subpage_prot.2: SYNOPSIS: Fix return type: s/long/int/

2020-11-28 Thread Michael Kerrisk (man-pages)
; index b38ba718f..d6f016665 100644 > --- a/man2/subpage_prot.2 > +++ b/man2/subpage_prot.2 > @@ -32,7 +32,7 @@ > subpage_prot \- define a subpage protection for an address range > .SH SYNOPSIS > .nf > -.BI "long subpage_prot(unsigned long " addr ", unsigned

Re: [PATCH] lseek.2: SYNOPSIS: Use correct types

2020-11-22 Thread Michael Kerrisk (man-pages)
gic either.) Thanks, Michael PS By the way, be aware that the code of many wrapper functions is autogenerated from "syscalls.list" files in the glibc source, for example, sysdeps/unix/sysv/linux/syscalls.list. This isn't the case for lseek(), though, as far as I can see; I think th

Re: [PATCH] lseek.2: SYNOPSIS: Use correct types

2020-11-22 Thread Michael Kerrisk (man-pages)
pe needs to be updated, please do so. > Especially, have a look at lseek64(3), > which I suspect needs the same changes I propose in that patch. I think that no changes to the types are needed in lseek64(3). But maybe some of the info in this mail should be captured in that manual page. Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/

Re: Update of file offset on write() etc. is non-atomic with I/O

2014-02-22 Thread Michael Kerrisk (man-pages)
On Sun, Feb 23, 2014 at 2:18 AM, Kevin Easton wrote: > On Fri, Feb 21, 2014 at 07:01:31AM +0100, Michael Kerrisk (man-pages) wrote: >> Here's the fulll list from POSIX.1-2008/SUSv4 Section XSI 2.9.7: >> >> [[ >> 2.9.7 Thread Interactions with Regular File Opera

man-pages-3.61 is released

2014-02-26 Thread Michael Kerrisk (man-pages)
erent enough from utime(2) that it warrants a separate page. Unlike the other *at() pages, the utimensat(2) page was also already self-contained, rather than defining itself in terms of differences from utime(2) as the other *at() pages did. access.2 Michael Kerrisk Merge text from fa

man-pages-3.62 is released

2014-03-12 Thread Michael Kerrisk (man-pages)
below. Cheers, Michael Changes in man-pages-3.62 New and rewritten pages --- locale.1 Michael Kerrisk [review from Mike Frysinger] New page describing locale(1) Newly documented interfaces in existing

Re: name_to_handle_at() and persistent filesystem IDs

2014-03-17 Thread Michael Kerrisk (man-pages)
Hello Aneesh, On Sun, Mar 16, 2014 at 4:08 PM, Aneesh Kumar K.V wrote: > Michael Kerrisk writes: > >> Hello Aneesh, >> >> I'm currently working on a man page for name_to_handle_at() and >> open_by_handle_at(), and I have a question relating to a point that >

For review: open_by_name_at(2) man page

2014-03-17 Thread Michael Kerrisk (man-pages)
Hi Aneesh, (and others) Below is a man page I've written for name_to_handle_at(2) and open_by_name_at(2). Would you be willing to review it please, and let me know of any corrections/improvements? Thanks, Michael '\" t -*- coding: UTF-8 -*- .\" Copyright (c) 201

Re: Update of file offset on write() etc. is non-atomic with I/O

2014-03-06 Thread Michael Kerrisk (man-pages)
Al about the patch) I confirm that this patch makes the problem that I'm seeing go away. Thanks for looking at this, Linus. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ --

For review: open_by_name_at(2) man page [v2]

2014-03-18 Thread Michael Kerrisk (man-pages)
uld you be willing to review it please, and let me know of any corrections/improvements? There are some FIXMEs in the page that I would especially like some help with. Thanks, Michael '\" t -*- coding: UTF-8 -*- .\" Copyright (c) 2014 by Michael Kerrisk .\" .\" %%%LIC

Re: For review: open_by_name_at(2) man page

2014-03-18 Thread Michael Kerrisk (man-pages)
On 03/17/2014 11:00 PM, NeilBrown wrote: > On Mon, 17 Mar 2014 16:57:29 +0100 "Michael Kerrisk (man-pages)" > wrote: > >> Hi Aneesh, (and others) >> >> Below is a man page I've written for name_to_handle_at(2) and >> open_by_name_at(2). Would y

Re: For review: open_by_name_at(2) man page

2014-03-18 Thread Michael Kerrisk (man-pages)
r uses info in /dev/disks/by-* or reads directly >> from the block devices (maybe using /sys to find them?) and interprets the >> superblock to extract a UUID. > > It normally reads directly from disk, unless it has changed very > recently. Thanks. As noted in my mail, I sol

Re: For review: open_by_name_at(2) man page

2014-03-18 Thread Michael Kerrisk (man-pages)
On 03/18/2014 10:37 AM, Christoph Hellwig wrote: > Hi Michael, > > the man page looks reasonable. If you refer to openat(2) instead of > open(2) in the ERRORS section you could avoid duplicating a few of the > dirfd and flags related errors. Good idea. Done. Cheers, Michae

Re: For review: open_by_name_at(2) man page

2014-03-18 Thread Michael Kerrisk (man-pages)
On 03/18/2014 02:07 PM, Christoph Hellwig wrote: > That's why the file handles contain a generation counter that gets > incremented in this case. Ahh, yes. Thanks for the reminder/clue. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-p

man-pages-3.63 is released

2014-03-18 Thread Michael Kerrisk (man-pages)
Released: 2014-03-18, Munich New and rewritten pages --- duplocale.3 Michael Kerrisk New page documenting duplocale(3) newlocale.3 Michael Kerrisk [Mike Frysinger] New page documenting newlocale(3) and freelocale(3) uselocale.3 Michael

Re: For review: open_by_name_at(2) man page

2014-03-19 Thread Michael Kerrisk (man-pages)
Hi Neil, On 03/18/2014 11:24 PM, NeilBrown wrote: > On Tue, 18 Mar 2014 13:37:15 +0100 "Michael Kerrisk (man-pages)" > wrote: > >> On 03/18/2014 10:43 AM, Christoph Hellwig wrote: >>> On Tue, Mar 18, 2014 at 09:00:07AM +1100, NeilBrown wrote: >>>>

Re: For review: open_by_name_at(2) man page [v2]

2014-03-19 Thread Michael Kerrisk (man-pages)
[CC =+ Al Viro] Hi Neil, On 03/19/2014 05:13 AM, NeilBrown wrote: > On Tue, 18 Mar 2014 13:55:15 +0100 "Michael Kerrisk (man-pages)" > wrote: > >> Hi Aneesh, (and others) >> >> After integrating review comments from NeilBown and Christoph Hellwig, >>

Re: For review: open_by_name_at(2) man page [v2]

2014-03-19 Thread Michael Kerrisk (man-pages)
Hi Mike, On 03/19/2014 07:42 AM, Mike Frysinger wrote: > On Tue 18 Mar 2014 13:55:15 Michael Kerrisk wrote: >> The >> .I flags >> argument is a bit mask constructed by ORing together >> zero or more of the following value: >> .TP >> .B AT_EMPTY_PATH &g

For review: open_by_handle_at(2) man page [v3]

2014-03-19 Thread Michael Kerrisk (man-pages)
tions/improvements? There are some FIXMEs in the page that I would especially like some help with. Thanks, Michael .\" Copyright (c) 2014 by Michael Kerrisk .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual pro

Re: recv function bug

2014-02-11 Thread Michael Kerrisk (man-pages)
(e.g., the UNIX and Internet domains) +permit zero-length datagrams. +When such a datagram is received, the return value is 0. + +The value 0 may also be returned if the requested number of bytes +to receive from a stream socket was 0. .SH ERRORS These are some standard errors generated by the socket

Re: Update of file offset on write() etc. is non-atomic with I/O

2014-02-20 Thread Michael Kerrisk (man-pages)
roubled by that, but it does appear to be a violation of 2.9.7. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linu

IEEE/TOG grant permission to distribute POSIX.1-2013 man pages for Linux

2014-01-22 Thread Michael Kerrisk (man-pages)
ort such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the lin

[PATCH] ipc: Fix 2 bugs in msgrcv() MSG_COPY implementation

2014-01-23 Thread Michael Kerrisk (man-pages)
ways of finding bugs in the API, as I've learned from a lot of experience. Best to do that documentation before releasing the API. Signed-off-by: Michael Kerrisk --- diff -ruNp linux-3.13/ipc/msg.c linux-3.13-msg_copy-fix/ipc/msg.c --- linux-3.13/ipc/msg.c2014-01-23 14:13:22.98938357

Things I wish I'd known about Inotify

2014-04-02 Thread Michael Kerrisk (man-pages)
w for the possibility that the IN_MOVED_FROM event was the last event that could fit in the buf‐ fer returned by the current call to read(2), and the accompanying IN_MOVED_TO event might be fetched only on the next read(2). -- Michael Kerrisk Linux man-pages maintainer; http://

Re: [PATCH] mm: msync: require either MS_ASYNC or MS_SYNC

2014-04-03 Thread Michael Kerrisk (man-pages)
Not that either of those things is desirable, but at >> least we can make the best of the situation. Probably better to be slow >> than to potentially lose someone's data in this case, > > This is a conservative alternative, but I'd rather not condone flags=0. > Oth

For review: open_by_handle_at(2) man page [v4]

2014-04-03 Thread Michael Kerrisk (man-pages)
et me know of any corrections/improvements? (Of course, further comments from anyone else are also welcome.) There are some FIXMEs in the page that I would especially like some help with. Thanks, Michael .\" Copyright (c) 2014 by Michael Kerrisk .\" .\" %%%LICENSE_START(VERBATI

Re: [PATCH] mm: msync: require either MS_ASYNC or MS_SYNC

2014-04-04 Thread Michael Kerrisk (man-pages)
Hi Greg, On 04/03/2014 02:57 PM, Greg Troxel wrote: > > "Michael Kerrisk (man-pages)" writes: > >> I think the only reasonable solution is to better document existing >> behavior and what the programmer should do. With that in mind, I've >> drafted th

Re: [PATCH] mm: msync: require either MS_ASYNC or MS_SYNC [resend]

2014-04-04 Thread Michael Kerrisk (man-pages)
>> check the return value, so will not notice an error return) will get the >> sync they desire. Not that either of those things is desirable, but at >> least we can make the best of the situation. Probably better to be slow >> than to potentially lose someone's data i

Re: Things I wish I'd known about Inotify

2014-04-04 Thread Michael Kerrisk (man-pages)
On 04/03/2014 10:52 PM, Jan Kara wrote: > On Thu 03-04-14 08:34:44, Michael Kerrisk (man-pages) wrote: >>Limitations and caveats >>The inotify API provides no information about the user or process >>that triggered the inotify event. In parti

Re: Things I wish I'd known about Inotify

2014-04-04 Thread Michael Kerrisk (man-pages)
[CC += Al Viro & Linux, since they also discussed the point about remote filesystems and /proc and /sys here: http://thread.gmane.org/gmane.linux.file-systems/83641/focus=83713 .] On 04/03/2014 05:38 PM, Eric W. Biederman wrote: > "Michael Kerrisk (man-pages)" writes: > &g

Re: For review: open_by_handle_at(2) man page [v4]

2014-04-04 Thread Michael Kerrisk (man-pages)
On 04/04/2014 12:45 PM, Aneesh Kumar K.V wrote: > "Michael Kerrisk (man-pages)" writes: >> The process receiving the handle can later perform operations >> on the symbolic link by converting the handle to a file descriptor using >> .BR open_by_handle_at () >>

Re: [PATCH] maps.2: fd for a file mapping must be opened for reading

2014-04-04 Thread Michael Kerrisk (man-pages)
.TP > .B EACCES > A file descriptor refers to a non-regular file. > -Or > -.B MAP_PRIVATE > -was requested, but > +Or a file mapping was requested, but > .I fd > is not open for reading. > Or > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org

Re: [PATCH] mm: msync: require either MS_ASYNC or MS_SYNC

2014-04-04 Thread Michael Kerrisk (man-pages)
On 04/03/2014 01:51 PM, Christopher Covington wrote: > On 04/03/2014 04:25 AM, Michael Kerrisk (man-pages) wrote: > >> I think the only reasonable solution is to better document existing >> behavior and what the programmer should do. With that in mind, I've >> draft

Re: Things I wish I'd known about Inotify

2014-04-06 Thread Michael Kerrisk (man-pages)
On 04/04/2014 02:43 PM, Jan Kara wrote: > On Fri 04-04-14 09:35:50, Michael Kerrisk (man-pages) wrote: >> On 04/03/2014 10:52 PM, Jan Kara wrote: >>> On Thu 03-04-14 08:34:44, Michael Kerrisk (man-pages) wrote: [...] >>>>Dealing with rename() events >&

man-pages-3.64 is released

2014-04-06 Thread Michael Kerrisk (man-pages)
readers of this list are given below. Cheers, Michael Changes in man-pages-3.64 New and rewritten pages --- open_by_handle_at.2 Michael Kerrisk [Mike Frysinger, Neil Brown, Aneesh Kumar K.V, Christoph Hellwig] New

man-pages-3.56 is released

2014-01-11 Thread Michael Kerrisk (man-pages)
pages - reboot.2 Elie De Brauwer Document LINUX_REBOOT_SW_SUSPEND Changes to individual pages --- close.2 Michael Kerrisk [P?draig Brady] Note that errors from close() should be used only for diagnosis

Re: [PATCH 1/1] fanotify: check permissions when creating file descriptor

2014-04-22 Thread Michael Kerrisk (man-pages)
>> + ret = inode_permission(event->path.dentry->d_inode, mask); >> + if (ret) >> + new_file = ERR_PTR(ret); >> + else >> + new_file = dentry_open(&event->path, >> +

Re: [PATCH 1/1] fanotify: check permissions when creating file descriptor

2014-04-22 Thread Michael Kerrisk (man-pages)
On Tue, Apr 22, 2014 at 3:50 PM, Michael Kerrisk (man-pages) wrote: > On Tue, Apr 22, 2014 at 3:40 PM, Jan Kara wrote: >> On Sat 19-04-14 22:53:53, Heinrich Schuchardt wrote: >>> When monitoring a directory or a mount with the fanotify API >>> the call to fanotify_init

Re: [PATCH] proc: fix documentation for /proc/stat, line "intr"

2014-04-22 Thread Michael Kerrisk (man-pages)
tal for that > particular > -interrupt. > +interrupts serviced including unnumbered architecture specific > interrupts; > +each subsequent column is the total for that particular numbered interrupt. > +Unnumbered interrupts are not shown, only summed into the total.

Re: [PATCH] proc: fix documentation for /proc/stat, line "intr"

2014-04-22 Thread Michael Kerrisk (man-pages)
On 04/23/2014 12:35 AM, Randy Dunlap wrote: > On 04/22/14 11:19, Michael Kerrisk (man-pages) wrote: >> On 04/22/2014 05:29 PM, Jan Moskyto Matejka wrote: >>> The sum at the beginning of line "intr" includes also unnumbered interrupts. >>> It implies that the

Re: [PATCH 4/4] ipc/shm.c: Increase the defaults for SHMALL, SHMMAX.

2014-04-22 Thread Michael Kerrisk (man-pages)
de */ > -#ifndef __KERNEL__ > -#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16)) > -#endif > +#define SHMMAX (ULONG_MAX - (1L<<24)) /* max shared seg size (bytes) > */ > +#define SHMALL (ULONG_MAX - (1L<<24)) /* max shm system wide (pages) > */

Re: [PATCH 2/4] ipc/shm.c: check for overflows of shm_tot

2014-04-22 Thread Michael Kerrisk (man-pages)
t + numpages < ns->shm_tot || > + ns->shm_tot + numpages > ns->shm_ctlall) > return -ENOSPC; > > shp = ipc_rcu_alloc(sizeof(*shp)); > Acked-by: Michael Kerrisk -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.

Re: [PATCH 3/4] ipc/shm.c: check for integer overflow during shmget.

2014-04-22 Thread Michael Kerrisk (man-pages)
s->shm_tot + numpages < ns->shm_tot || > ns->shm_tot + numpages > ns->shm_ctlall) > return -ENOSPC; > Acked-by: Michael Kerrisk -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming

Re: [PATCH 5/4] ipc,shm: minor cleanups

2014-04-22 Thread Michael Kerrisk (man-pages)
t; - if (addr < current->mm->start_stack && > - addr > current->mm->start_stack - size - PAGE_SIZE * 5) > + if (addr < mm->start_stack && > + addr > mm->start_stack - size - PAGE_SIZE * 5) >

Re: [PATCH 1/4] ipc/shm.c: check for ulong overflows in shmat

2014-04-22 Thread Michael Kerrisk (man-pages)
mmap_sem); > if (addr && !(shmflg & SHM_REMAP)) { > err = -EINVAL; > + if (addr + size < addr) > + goto invalid; > + > if (find_vma_intersection(current->mm, addr, addr + size)) > goto inval

Re: [PATCH] proc: fix documentation for /proc/stat, line "intr"

2014-04-22 Thread Michael Kerrisk (man-pages)
On Wed, Apr 23, 2014 at 12:35 AM, Randy Dunlap wrote: > On 04/22/14 11:19, Michael Kerrisk (man-pages) wrote: >> On 04/22/2014 05:29 PM, Jan Moskyto Matejka wrote: >>> The sum at the beginning of line "intr" includes also unnumbered interrupts. >>> It implie

Re: [PATCH 5/4] ipc,shm: minor cleanups

2014-04-22 Thread Michael Kerrisk (man-pages)
On 04/23/2014 07:25 AM, Davidlohr Bueso wrote: > On Wed, 2014-04-23 at 07:07 +0200, Michael Kerrisk (man-pages) wrote: >> On 04/23/2014 04:53 AM, Davidlohr Bueso wrote: >>> - Breakup long function names/args. >>> - Cleaup variable declaration. >>> - s/

Re: [RFC][glibc PATCH] fcntl-linux.h: add new definitions and manual updates for open file description locks

2014-04-23 Thread Michael Kerrisk (man-pages)
is all done within the context of > +the same process. That leads to data corruption (typically manifested > +as missing lines) as some threads race in and overwrite the data from s/from/written by/ > +others. > + > @node Interrupt Input > @section Interrupt-Driven Input >

Re: [PATCH] proc: fix documentation for /proc/stat, line "intr"

2014-04-23 Thread Michael Kerrisk (man-pages)
On 04/23/2014 11:48 AM, Jan Moskyto Matejka wrote: > n Tue, Apr 22, 2014 at 03:35:39PM -0700, Randy Dunlap wrote: >> On 04/22/14 11:19, Michael Kerrisk (man-pages) wrote: >>> On 04/22/2014 05:29 PM, Jan Moskyto Matejka wrote: >>>> The sum at the beginning of line &

Re: [PATCH 11/11] ext4: add cross rename support

2014-04-23 Thread Michael Kerrisk (man-pages)
On 04/23/2014 04:21 PM, Miklos Szeredi wrote: > On Sat, Apr 19, 2014 at 11:08 AM, Michael Kerrisk (man-pages) > wrote: >> Hi Miklos, >> >>> The code changes are pushed to the git tree and the updated man page is >>> below. >> >> Now that renameat2(

Re: [RFC][glibc PATCH] fcntl-linux.h: add new definitions and manual updates for open file description locks

2014-04-23 Thread Michael Kerrisk (man-pages)
eff -- this really is a "test" (or "can I lock it") operation. Of course, the operation has no reliable use: by the time it returns the information might already be out of date. I suspect that it was designed to solve the problem: "My F_GETLK operation failed. Who's bl

Re: [PATCH 5/4] ipc,shm: minor cleanups

2014-04-23 Thread Michael Kerrisk (man-pages)
On 04/23/2014 07:25 AM, Davidlohr Bueso wrote: > On Wed, 2014-04-23 at 07:07 +0200, Michael Kerrisk (man-pages) wrote: >> On 04/23/2014 04:53 AM, Davidlohr Bueso wrote: >>> - Breakup long function names/args. >>> - Cleaup variable declaration. >>> - s/

Re: [PATCH 1/1] fanotify: for FAN_MARK_FLUSH check flags

2014-04-23 Thread Michael Kerrisk (man-pages)
s likely vanishingly small. So, a qualified Acked-by: Michael Kerrisk Cheers, Michael > --- > fs/notify/fanotify/fanotify_user.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/notify/fanotify/fanotify_user.c > b/fs/notify/fanotify/fanotify_user.c > in

Re: [glibc PATCH v2] fcntl-linux.h: add new definitions and manual updates for open file description locks

2014-04-24 Thread Michael Kerrisk (man-pages)
t leads to data corruption > +(typically manifested as missing lines) as some threads race in and > +overwrite the data written by others. > + > @node Interrupt Input > @section Interrupt-Driven Input > > diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h > b/sysdeps/un

Re: [glibc PATCH v2] fcntl-linux.h: add new definitions and manual updates for open file description locks

2014-04-24 Thread Michael Kerrisk (man-pages)
On 04/24/2014 02:39 PM, Jeff Layton wrote: > On Thu, 24 Apr 2014 14:31:43 +0200 > "Michael Kerrisk (man-pages)" wrote: > >> Jeff, >> >> Did you receive my mail with comments on the previous patch? >> (I got no reply.) It looks like some of those comme

Re: [glibc PATCH v2] fcntl-linux.h: add new definitions and manual updates for open file description locks

2014-04-24 Thread Michael Kerrisk (man-pages)
lock > +equivalents, the locking essentially becomes a noop since it is all done > +within the context of the same process. That leads to data corruption > +(typically manifested as missing lines) as some threads race in and > +overwrite the data written by others. > + > @node Interru

Re: [PATCH 1/1] fanotify: check permissions when creating file descriptor

2014-04-24 Thread Michael Kerrisk (man-pages)
On Thu, Apr 24, 2014 at 3:54 PM, Heinrich Schuchardt wrote: > On 24.04.2014 11:04, Jan Kara wrote: >> >> On Tue 22-04-14 16:07:47, Jan Kara wrote: >>> >>> On Tue 22-04-14 15:50:26, Michael Kerrisk (man-pages) wrote: >>>> >>>> On Tue, Apr 22

Re: [glibc PATCHi v4] fcntl-linux.h: add new definitions and manual updates for open file description locks

2014-04-24 Thread Michael Kerrisk (man-pages)
ially becomes a noop since it is all done > +within the context of the same process. That leads to data corruption > +(typically manifested as missing lines) as some threads race in and > +overwrite the data written by others. > + > @node Interrupt Input > @section Interrupt-Driven

Re: [glibc PATCHi v4] fcntl-linux.h: add new definitions and manual updates for open file description locks

2014-04-24 Thread Michael Kerrisk (man-pages)
On Thu, Apr 24, 2014 at 5:11 PM, Jeff Layton wrote: > On Thu, 24 Apr 2014 17:07:11 +0200 > "Michael Kerrisk (man-pages)" wrote: > >> Jeff, >> >> Please let us know what changed from one version to the next. I've no >> idea without looking i

Re: [PATCH 1/1] fanotify: check permissions when creating file descriptor

2014-04-24 Thread Michael Kerrisk (man-pages)
ose capabilities which > is too broad) Yup. https://lwn.net/Articles/486306/ > but I agree checking permissions when creating the fd is > reasonable. > > Honza > -- > Jan Kara > SUSE Labs, CR -- Micha

<    1   2   3   4   5   6   7   8   9   10   >