Commit Graph

7980 Commits

Author SHA1 Message Date
Michael Kerrisk dcd7215c2a io_submit.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-25 08:59:54 +13:00
Jeff Moyer 19dc28eb9d io_submit.2: Fix the description of aio_data
aio_data is not a kernel-internal field.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-25 08:59:19 +13:00
Lucas Werkmeister a25c60362b close.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-16 05:39:14 +13:00
Michael Kerrisk 352c4c5ca6 open.2: Minor fixes to Eugene's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:42:35 +13:00
Eugene Syromiatnikov 6deb3733ac open.2: Mention presence of unused O_RSYNC definition
O_RSYNC is defined in <asm/fcntl.h> on HP PA-RISC, but is not
used anyway.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:35:10 +13:00
Michael Kerrisk d40e0bfc27 open.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:34:38 +13:00
Michael Kerrisk 319e9b31ed open.2: Minor fixes to Eugene's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:32:39 +13:00
Eugene Syromiatnikov 8132c11589 open.2: Document FASYNC usage in Linux UAPI headers
Linux's <asm/fcntl.h> defines FASYNC instead of O_ASYNC; document
this peculiarity.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:30:47 +13:00
Michael Kerrisk ecb110e846 rename.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:25:18 +13:00
Eugene Syromiatnikov 5fc33f3827 rename.2: Some additional notes regarding RENAME_WHITEOUT
Add a note regarding other implementations of whiteout inodes
and update filesystem support information.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:24:50 +13:00
Michael Kerrisk b0f5ce2757 getgid.2, getpid.2, getuid.2, pipe.2: Remove mention of other syscalls that use second retval register
This information is already summarized in syscall(2), so there's
no need to repeat it in each page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:21:17 +13:00
Michael Kerrisk 127f815c99 syscall.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:18:39 +13:00
Michael Kerrisk 17eb18e79a syscall.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:18:39 +13:00
Michael Kerrisk 0e80287f28 syscall.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:18:39 +13:00
Michael Kerrisk 7548a84a6c syscall.2: Rework table to render within 80 columns
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:18:39 +13:00
Michael Kerrisk 03936fb4ce getgid.2, getpid.2, getuid.2, pipe.2, syscall.2: Minor tweaks to Eugene's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 06:18:39 +13:00
Eugene Syromiatnikov 70ea1968cc getgid.2, getpid.2, getuid.2, pipe.2, syscall.2: Describe 2nd return value peculiarity
Some architectures (ab)use second return value register for additional
return value in some system calls. Let's describe this.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-10 05:46:35 +13:00
Eugene Syromiatnikov f3f3ab82ee syscall.2: ffix
Add missing .RE.

Fixes: 2ad7b4c46c ("syscall.2: Elaborate x32 ABI specifics")
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-01-09 16:58:31 +13:00
Michael Kerrisk 43e3c5518b select.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-23 19:09:33 +01:00
Michael Kerrisk 3d335319e7 write.2: RETURN VALUE: clarify details of partial write and
As reported by Nadav Har'El in
https://bugzilla.kernel.org/show_bug.cgi?id=197961

    The write(2) manual page has this paragraph:

    "On  success,  the  number  of bytes written is returned
    (zero indicates nothing was written).  It is not an error
    if  this  number  is  smaller than the number of bytes
    requested; this may happen for example because the disk
    device was filled.  See also NOTES."

    I find a few problems with this paragraph:

    1. It's not clear what "See also NOTES." refers to (does it
       refer to anything?). What in the NOTES is relevant here?

    2. The paragraph seems to suggest that write(2) of a
       non-empty buffer may sometimes return even 0 in case of an
       error like the device being filled. I think this is wrong
       - if there was an error after already writing some number
       of bytes, this non-zero number is returned. But if there's
       an error before writing any bytes, -1 will be returned
       (and the error reason in errno) - 0 will not be returned
       unless the given count is 0 (that case is explained in the
       following paragraph).

    3. The paragraph doesn't explain what a user should do
       after a short write (i.e., write(2) returning less than
       count). How would the user know why there was an error, or
       if there even was one? I think users should be told what
       to do next because this information is part of how to use
       this API correctly. I think users should be told to retry
       the rest of the write (i.e., write(fd, buf+ret, count-ret)
       and this will either succeed in writing some more data if
       the error reason was solved, or the second write will
       return -1 and the error reason in errno.

Reported-by: Nadav Har'El <nyh@math.technion.ac.il>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-23 19:09:33 +01:00
Michael Kerrisk acac1139a6 getxattr.2, removexattr.2, setxattr.2: ERRORS: replace ENOATTR with ENODATA
ENOATTR is not a standard error code, but rather one that is
defined in 'libattr' as a synonym for ENODATA. The manual pages
should use the error code actually returned by the kernel APIs.

See also https://bugzilla.kernel.org/show_bug.cgi?id=201995

Reported-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-23 19:09:18 +01:00
Michael Kerrisk d70a2e571d mount.2: wfix (clarify effect of unbindable propagation type)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-14 11:35:40 +01:00
snyh 2e75672790 syscall.2: Fix wrong retval register number in alpha architecture
alpha use v0 e.g. $0 as the return value register both in
syscall ABI and C ABI.

see also
https://github.com/torvalds/linux/blob/master/arch/alpha/kernel/entry.S#L479

The normal Alpha C ABI use a0~a5 to pass arguments and use v0 as
the return value register. See here
https://www2.cs.arizona.edu/projects/alto/Doc/local/alpha.register.html

The syscall ABI use v0 as the trap number, a0~a5 to pass arguments
and use a3 as a indicator (bool type) whether has a error occurred.

We can also see the libc's syscall wrapper implements at
https://code.woboq.org/userspace/glibc/sysdeps/unix/sysv/linux/alpha/syscall.S.html
The v0 is the normal used as return register, and we can see the
return processing doesn't do anything about a0 which is the wrong
register of currently syscall(2) description.

p.s. I found this wrong description because I'm porting Go gc to
a new CPU architecture which is similar to Alpha, And I use the
wrong register at first, then I have inspect the kernel code and
objdump to ensure the right syscall ABI.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-08 14:44:15 +01:00
Vince Weaver 34211ee3f2 perf_event_open.2: Fix wording in multiplexing description
Back in 2014 (37bee118ad) the text
describing when multiplexing happens was changed in a confusing way.
This is an attempt to clarify things a bit.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-03 22:10:30 +01:00
Michael Kerrisk 07ca8b34a0 madvise.2: Minor tweaks to Michal Hocko's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-01 09:53:19 +01:00
Michal Hocko 9bbc50e6e0 madvise.2: MADV_FREE clarify swapless behavior
Since 93e06c7a6453 ("mm: enable MADV_FREE for swapless system") we
handle MADV_FREE on a swapless system the same way as with the
swap available. Clarify that fact in the man page.

Reported-by: Niklas Hambüchen <mail@nh2.me>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-01 09:48:46 +01:00
Michael Kerrisk 7f11e32c39 accept.2, copy_file_range.2, eventfd.2, inotify_init.2, pipe.2, readahead.2, signalfd.2, socket.2, timerfd_create.2: Clarify the distinction between "file descriptor" and "file description"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-01 09:42:01 +01:00
Michael Kerrisk 735e291284 eventfd.2: Move text noting that eventfd() creates a FD earlier in the page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-01 09:30:07 +01:00
Michael Kerrisk 839d161f0f clone.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-01 09:21:05 +01:00
Michael Kerrisk a202ed9396 ioctl_console.2, ctime.3: tfix
Reported-by: Anatoly Borodin <anatoly.borodin@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-27 18:28:31 +01:00
Dmitry V. Levin b29cd73f56 ptrace.2: Do not say that PTRACE_O_TRACESYSGOOD may not work
Remove the old statement that PTRACE_O_TRACESYSGOOD may not work
on all architectures.  As far as I can tell, all kernel code
properly tests PT_TRACESYSGOOD flag and sets the 7th bit in the
exit code passed to ptrace_notify().

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-27 08:14:54 +01:00
Michael Kerrisk 4a5a783d8f prctl.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-24 20:54:48 +01:00
Michael Kerrisk a32c96b894 prctl.2: Explain the circumstances in which the parent-death signal is sent
To test the behavior documented by this patch, the following
demos employ the program shown at the foot of this commit message.

First, show that the pdeath signal is sent when the parent
terminates:

$ ./pdeath_signal 0 10 4
Parent (18595) about to sleep for 4 seconds
Child about to set PR_SET_PDEATHSIG
Child about to sleep
Parent (18595) terminating
*********** Child (18596) got signal; si_pid = 18595; si_uid = 1000
            Parent PID is now 1403
$ Child about to exit

But the signal is not sent if the parent terminates before the
child uses PR_SET_PDEATHSIG:

$ ./pdeath_signal 2 10  0
Parent (18707) about to sleep for 0 seconds
Parent (18707) terminating
Child about to sleep 2 seconds before setting PR_SET_PDEATHSIG
$ Child about to set PR_SET_PDEATHSIG
Child about to sleep
Child about to exit

Demonstrate that the pdeath signal is sent on termination of each
ancestor subreaper process:

$ ./pdeath_signal 2 10 3 7 6 5
18786 marked itself as a subreaper
18786 subreaper about to sleep 7 seconds
18787 marked itself as a subreaper
18787 subreaper about to sleep 6 seconds
18788 marked itself as a subreaper
18788 subreaper about to sleep 5 seconds
Parent (18789) about to sleep for 3 seconds
Child about to sleep 2 seconds before setting PR_SET_PDEATHSIG
Child about to set PR_SET_PDEATHSIG
Child about to sleep
Parent (18789) terminating
*********** Child (18790) got signal; si_pid = 18789; si_uid = 1000
            Parent PID is now 18788
18788 subreaper about to terminate
*********** Child (18790) got signal; si_pid = 18788; si_uid = 1000
            Parent PID is now 18787
18787 subreaper about to terminate
*********** Child (18790) got signal; si_pid = 18787; si_uid = 1000
            Parent PID is now 18786
18786 subreaper about to terminate
*********** Child (18790) got signal; si_pid = 18786; si_uid = 1000
            Parent PID is now 1403
$ Child about to exit

But in the case where some subreapers terminate before they
have a chance to adopt the child, the terminations of those
subreapers do not result in a signal for the child:

$ ./pdeath_signal 2 10 3 5 6 7
18836 marked itself as a subreaper
18836 subreaper about to sleep 5 seconds
18837 marked itself as a subreaper
18837 subreaper about to sleep 6 seconds
18838 marked itself as a subreaper
18838 subreaper about to sleep 7 seconds
Parent (18839) about to sleep for 3 seconds
Child about to sleep 2 seconds before setting PR_SET_PDEATHSIG
Child about to set PR_SET_PDEATHSIG
Child about to sleep
Parent (18839) terminating
*********** Child (18840) got signal; si_pid = 18839; si_uid = 1000
            Parent PID is now 18838
18836 subreaper about to terminate
$ 18837 subreaper about to terminate
18838 subreaper about to terminate
*********** Child (18840) got signal; si_pid = 18838; si_uid = 1000
            Parent PID is now 1403
Child about to exit

============================

/* pdeath_signal.c */

                        } while (0)

static void
handler(int sig, siginfo_t *si, void *ucontext)
{
    printf("*********** Child (%ld) got signal; si_pid = %d; si_uid = %d\n",
            (long) getpid(), si->si_pid, si->si_uid);
    printf("            Parent PID is now %ld\n", (long) getppid());
}

int
main(int argc, char *argv[])
{
    struct sigaction sa;
    int childPreSleep, childPostSleep, parentSleep;

    if (argc < 2) {
        fprintf(stderr, "Usage: %s child-pre-sleep "
                "[child-post-sleep [parent-sleep [subreaper-sleep...]]]\n",
                argv[0]);
        exit(EXIT_FAILURE);
    }

    childPreSleep = atoi(argv[1]);
    if (argc > 2)
        childPostSleep = atoi(argv[2]);
    if (argc > 3)
        parentSleep = atoi(argv[3]);

    /* Optionally create a series of subreapers */

    if (argc > 4) {
        for (int sr = 4; sr < argc; sr++) {
            if (prctl(PR_SET_CHILD_SUBREAPER, 1) == -1)
                errExit("prctl");
            printf("%ld marked itself as a subreaper\n", (long) getpid());
            switch (fork()) {
            case -1:
                errExit("fork");
            case 0:
                break;
            default:
                printf("%ld subreaper about to sleep %s seconds\n",
                        (long) getpid(), argv[sr]);
                sleep(atoi(argv[sr]));
                printf("%ld subreaper about to terminate\n", (long) getpid());
                exit(EXIT_SUCCESS);
            }
        }
    }

    switch (fork()) {
    case -1:
        errExit("fork");

    case 0:
        sa.sa_flags = SA_SIGINFO;
        sigemptyset(&sa.sa_mask);
        sa.sa_sigaction = handler;
        if (sigaction(SIGUSR1, &sa, NULL) == -1)
            errExit("sigaction");

        if (childPreSleep > 0) {
            printf("Child about to sleep %d seconds before setting "
                    "PR_SET_PDEATHSIG\n", childPreSleep);
            sleep(childPreSleep);
        }

        printf("Child about to set PR_SET_PDEATHSIG\n");
        if (prctl(PR_SET_PDEATHSIG, SIGUSR1) == -1)
            errExit("prctl");

        printf("Child about to sleep\n");
        for (int j = 0; j < childPostSleep; j++)
            sleep(1);

        printf("Child about to exit\n");
        exit(EXIT_SUCCESS);

    default:
        printf("Parent (%ld) about to sleep for %d seconds\n",
                (long) getpid(), parentSleep);
        sleep(parentSleep);
        printf("Parent (%ld) terminating\n", (long) getpid());
        exit(EXIT_SUCCESS);
    }
}

Reported-by: Jann Horn <jann@thejh.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-24 13:00:52 +01:00
Michael Kerrisk 29b249db56 prctl.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-24 12:44:27 +01:00
Michael Kerrisk fdda93639e prctl.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-24 11:25:28 +01:00
Michael Kerrisk e256205a55 prctl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-24 11:23:55 +01:00
Michael Kerrisk 300a9c78f3 prctl.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-24 11:22:47 +01:00
Michael Kerrisk a09b5995c3 prctl.2: Add additional info on PR_SET_PDEATHSIG
The signal is process directed and the siginfo_t->si_pid
filed contains the PID of the terminating parent.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-24 11:20:09 +01:00
Michael Kerrisk 910b068989 prctl.2: Rework the PR_SET_PDEATHSIG description a little, for easier readability
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-24 10:47:21 +01:00
Michael Kerrisk c5236575ca prctl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-24 10:38:07 +01:00
Jann Horn c62b945324 ptrace.2: BUGS: ptrace() may set errno to zero
ptrace() with requests PTRACE_PEEKTEXT, PTRACE_PEEKDATA and
PTRACE_PEEKUSER can set errno to zero. AFAICS this is for a good
reason (so that you can tell the difference between a successful
PEEK with a result of -1 and a failed PEEK, even if you forget to
clear errno yourself), but it technically violates the rules
described in the errno.3 manpage.

glibc snippet from sysdeps/unix/sysv/linux/ptrace.c:

  res = INLINE_SYSCALL (ptrace, 4, request, pid, addr, data);
  if (res >= 0 && request > 0 && request < 4)
    {
      __set_errno (0);
      return ret;
    }

reproducer:

$ cat ptrace_test.c
char foobar_data[4] = "ABCD";
int main(void) {
  pid_t child = fork();
  if (child == -1) err(1, "fork");
  if (child == 0) {
    if (prctl(PR_SET_PDEATHSIG, SIGKILL)) err(1, "prctl");
    while (1) sleep(1);
  }
  int status;
  if (ptrace(PTRACE_ATTACH, child, NULL, NULL)) err(1, "attach");
  if (waitpid(child, &status, 0) != child) err(1, "wait");
  errno = EINVAL;
  unsigned int res = ptrace(PTRACE_PEEKDATA, child, foobar_data, NULL);
  printf("errno after PEEKDATA: %d\n", errno);
  printf("PEEKDATA result: 0x%x\n", res);
}
$ gcc -o ptrace_test ptrace_test.c -Wall
$ ./ptrace_test
errno after PEEKDATA: 0
PEEKDATA result: 0x44434241

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-24 08:16:03 +01:00
Jann Horn d6868c69b3 clone.2: Pending CLONE_NEWPID prevents thread creation
See copy_process() in kernel/fork.c:

	if (clone_flags & CLONE_THREAD) {
		if ((clone_flags & (CLONE_NEWUSER | CLONE_NEWPID)) ||
		    (task_active_pid_ns(current) !=
				current->nsproxy->pid_ns_for_children))
			return ERR_PTR(-EINVAL);
	}

current->nsproxy->pid_ns_for_children is where unshare(CLONE_NEWPID)
stashes the pending namespace.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-24 08:13:11 +01:00
Michael Kerrisk d6bec36eca clone.2, prctl.2, st.4, proc.5: Change references to '2.6.0-test*' series kernels to just '2.6.0'
The extra detail has little of noting with -test 2.6.0
added a particular feature has little value these days,
and is likely to confuse some readers who don't know
(and probably don't care) about the historical details.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-19 13:09:55 +01:00
Michael Kerrisk 44645ac4db getgroups.2: Note that a process can drop all groups with: setgroups(0, NULL)
Checking the FreeBSD source code, there's explicit support for
this to accommodate non-BSD systems (such as Linux).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-19 13:09:46 +01:00
Benjamin Peterson 915c4ba36f futex.2: Make the example use C11 atomics rather than GCC builtins
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 08:21:51 +01:00
Mike Rapoport a2463bae6f ioctl_userfaultfd.2, madvise.2, memfd_create.2, migrate_pages.2, mmap.2, shmget.2, subpage_prot.2, userfaultfd.2, malloc.3, proc.5, sysfs.5, tmpfs.5: Update paths for in-kernel memory management documentation files
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 07:29:53 +01:00
Michael Kerrisk cf0866501d prctl.2: Note libcap(3) APIs for operating on ambient capability set
(However, the libcap APIs do not yet seem to have
manual pages...)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-16 21:45:10 +01:00
Michael Kerrisk d9a0d1d7b7 prctl.2: Mention libcap APIs for operating on capability bounding set
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-16 21:32:45 +01:00
Michael Kerrisk 6a1634dc09 syscalls.2: Update syscall list for Linux 4.18
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-11 08:07:35 +01:00
Anthony Iliopoulos 99de80c58b ioctl_userfaultfd.2, userfaultfd.2: wfix
Use "UFFDIO_ZEROPAGE" consistently rather than "UFFDIO_ZERO".

Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-10 07:12:40 +01:00
Michael Kerrisk 52fc743c1b pivot_root.2: Minor fixes to Elvira Khabirova's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-09 08:54:20 +01:00
Elvira Khabirova 82320f4201 pivot_root.2: Explain the initramfs case and point to switch_root(8).
Based on text from Documentation/filesystems/ramfs-rootfs-initramfs.txt.

Signed-off-by: Elvira Khabirova <lineprinter@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-09 08:52:40 +01:00
Helge Deller 8c3e685486 syscalls.2: parisc Linux does not any longer emulate HP-UX
Initially it was planned that the parisc linux port would natively
support 32-bit HP-UX binaries, but this compatibility was never
reached and finally dropped with Linux kernel 3.14.

With that background, drop parisc from the list of of platforms
which supports it's proprietary operating-system.

Additional notes from mtk:

The most relevant commit from the Linux 3.14 change log was:

[[
commit f5a408d53edef3af07ac7697b8bc54a755628450
Author: Guy Martin <gmsoft@tuxicoman.be>
Date:   Thu Jan 16 17:17:53 2014 +0100

    parisc: Make EWOULDBLOCK be equal to EAGAIN on parisc

    On Linux, only parisc uses a different value for EWOULDBLOCK which
    causes a lot of troubles for applications not checking for both values.
    Since the hpux compat is long dead, make EWOULDBLOCK behave the same as
    all other architectures.
]]

Additional notes from Helge:

The patch above is the initial and most important one with which
we stopped the HP-UX compatibility.

Then, with this commit in kernel 3.18 there is no way back:
"parisc: Reduce SIGRTMIN from 37 to 32 to behave like
other Linux architectures"
commit 1f25df2eff5b25f52c139d3ff31bc883eee9a0ab

And in kernel 4.0 we finally dropped the HP-UX compat layer
from Linux kernel source code with the commit series
"parisc: hpux - Drop support for HP-UX binaries":
commit 04c1614977168fb8f002e2d81f704eeabe0c5ebd

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-07 22:35:09 +01:00
Helge Deller 6f1033653f syscall.2: parisc needs care with syscall parameters
On parisc one needs to take care of the 32-bit calling conventions
with 64-bit syscall parameters on a 32-bit kernel. So on parisc we
suffer from the same issues like ARM, PowerPC and Xtensa.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-07 21:30:33 +01:00
Josh Gao b085fc1fca io_submit.2: tfix
Signed-off-by: Josh Gao <jmgao@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-06 23:52:20 +01:00
Michael Kerrisk 7159b279cc rename.2: tfix
Reported-by: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 20:37:20 +01:00
Michael Kerrisk 010a79cd86 rename.2: wfix: s/shmem/tmpfs/ in discussion of RENAME_NOREPLACE
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 17:41:49 +01:00
Michael Kerrisk 9738a72a0b rename.2: XFS support for RENAME_NOREPLACE was added in Linux 4.0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 17:40:15 +01:00
Michael Kerrisk 62f68f105d rename.2: Rework list of supported filesystems for RENAME_NOREPLACE
There was probably a little too much detail in
Lukas Werkmeister's patch. Simplify, by removing a few
file systems, and arrange the information as a bulleted
list for easier readability.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 17:40:15 +01:00
Lucas Werkmeister 94b9d26faa rename.2: Add kernel versions for RENAME_NOREPLACE support
The RENAME_NOREPLACE flag was added with the initial release of the
renameat2 syscall in Linux 3.15, but support for most filesystems was
only added in later versions, and some may still not support it.

Signed-off-by: Lucas Werkmeister <mail@lucaswerkmeister.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 17:16:36 +01:00
Michael Kerrisk b79b66d119 getrlimit.2: Resource limits are process-wide attributes shared by all threads
This was already noted in pthreads(7), but bears repeating here.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 15:23:19 +01:00
Michael Kerrisk 1c1ccb2c65 mount.2: Document EROFS for read-only filesystems
See https://bugzilla.kernel.org/show_bug.cgi?id=200649

Reported-by: Harry Mallon <hjmallon@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 10:15:23 +01:00
Michael Kerrisk ed6d190860 mount.2: EACCES: note some reasons why a filesystem may be read-only
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 10:12:00 +01:00
Michael Kerrisk 642df17c43 prctl.2: Add some further historical details on PR_SET_MM_EXE_FILE
Also some minor tweaks to Benjamin Peterson's patch.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 08:29:13 +01:00
Benjamin Peterson 47bc9cec30 prctl.2: PR_SET_MM_EXE_FILE may now be used as many times as desired
The original implementation of PR_SET_MM_EXE_FILE only allowed it
to be used once in a process's lifetime. This restriction was
lifted in Linux commit 3fb4afd9a504c2386b8435028d43283216bf588e
("prctl: remove one-shot limitation for changing exe link").

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 08:15:12 +01:00
Michael Kerrisk d2eeb68f0b prctl.2: wfix: Remove a redundant sentence
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 08:14:44 +01:00
Michael Kerrisk c020b5a217 msgctl.2, semctl.2, shmctl.2: Some small wording improvements for Davidlohr Bueso's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 17:28:24 +01:00
Michael Kerrisk 5593795fc3 msgctl.2: tfix
Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 17:19:36 +01:00
Michael Kerrisk 14cbb25e36 msgctl.2, semctl.2, shmctl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 17:17:07 +01:00
Davidlohr Bueso d2ff4f8619 msgctl.2, semctl.2, shmctl.2: Document STAT_ANY commands
Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-04 17:10:47 +01:00
Quentin Monnet 3bcfaff627 bpf.2: SEE ALSO: add bpf-helpers(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 21:23:56 +01:00
Michael Kerrisk c3617f39b6 mmap.2: tfix
Reported-by: Thomas Posch <kernel.org@online.posch.name>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-01 18:23:33 +01:00
Marc-André Lureau 659beec775 memfd_create.2: Update hugetlb file-sealing support
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-31 08:09:55 +01:00
Jakub Wilk 9d32816ba3 clone.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-27 08:58:11 +02:00
Jakub Wilk f5e9811444 adjtimex.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-27 08:56:43 +02:00
Xiao Yang 63c1260a32 readv.2: Fix wrong errno for an unknown flag
[I got two patches for this; the other from Florian Weimer]

According to the following kernel code, preadv2(2)/pwritev2(2) with
an unknown flag actually returned EOPNOTSUPP instead of EINVAL:
----------------------------------------------------------------
static inline int kiocb_set_rw_flags(struct kiocb *ki, rwf_t flags)
{
	if (unlikely(flags & ~RWF_SUPPORTED)) {
		return -EOPNOTSUPP;
	}
	...
}

static ssize_t do_loop_readv_writev(struct file *filp, struct iov_iter *iter,
		loff_t *ppos, int type, rwf_t flags)
{
	...
	if (flags & ~RWF_HIPRI)
		return -EOPNOTSUPP;
	...
}

Reported-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-27 08:37:24 +02:00
Kees Cook 7b10f505cf seccomp.2, ptrace.2, move_pages.2: tfix
This fixes three typos of EACCES (one "S" is the correct errno
name).

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-26 19:38:39 +02:00
Michael Kerrisk cd1c5b9d41 setuid.2: Clarify EPERM capability requirements with respect to user namespaces
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-19 12:31:27 +02:00
Michael Kerrisk 51c11a7059 setgid.2: Clarify EPERM capability requirements with respect to user namespaces
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-19 12:30:39 +02:00
Michael Kerrisk a42a171f7d msgop.2: Correct the capability description for msgsnd() EACCESS error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-19 12:26:49 +02:00
Michael Kerrisk 83a9c27ce9 getrlimit.2, ioprio_set.2, msgop.2, select.2: Remove superfluous uses of the word "respectively"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-16 11:58:08 +02:00
Michael Kerrisk 8dcb9145b1 socket.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-16 11:27:05 +02:00
Eugene Syromyatnikov fcac1f5ab8 socketpair.2: Note that AF_TIPC also supports socketpair(2)
Introduced by Linux commit v4.12-rc1~64^3~304^2~1.

Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-16 10:47:30 +02:00
Michael Kerrisk af608f3bbd socket.2: Remove some more obscure protocols from address family list
The list of address families in this page is still
overwhelmingly long. So let's shorten it.
The removed entries are all in address_families(7).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-16 10:46:49 +02:00
Michael Kerrisk 43c8308e3c socket.2: Add cross reference to address_families(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-16 10:46:49 +02:00
Michael Kerrisk 698c7b2f16 socket.2: Simplify list of address families
Remove many of the details that are in address_families(7)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-16 10:46:49 +02:00
Michael Kerrisk c3199b187e socket.2: Remove a few obsolete protocols
Documentation for these remains in address_families(7)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-16 10:46:42 +02:00
Michael Kerrisk 1d8a25bd2a socket.2: Remove references to external docs
This information is all in address_families(7)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-16 10:46:24 +02:00
Michael Kerrisk e900e16c3b socket.2: Minor tweaks to Eugene Syromyatnikov's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-16 09:04:16 +02:00
Eugene Syromyatnikov 5880549a1d socket.2: Add information on other address families
Add some information about some other address families present in
<linux/socket.h>.

Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-16 08:23:02 +02:00
Eugene Syromyatnikov ee7a193dfc syscalls.2: Note about s390x and old_mmap
Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-15 08:17:26 +02:00
Eugene Syromyatnikov 85722724a0 readdir.2: Fix struct old_linux_dirent in accordance with current definition
Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 21:40:14 +02:00
Eugene Syromyatnikov 7831908942 syscalls.2: Note that not all architectures return errno negated
Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 21:38:02 +02:00
Eugene Syromyatnikov 2c2b424fad getrlimit.2: Note that setrlimit(RLIMIT_CPU) doesn't fail
Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 20:48:25 +02:00
Michael Kerrisk 5b7630723c syscall.2: Some fixes to Eugene Syromyatnikov's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 16:49:42 +02:00
Eugene Syromyatnikov 2ad7b4c46c syscall.2: Elaborate x32 ABI specifics
Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 16:49:42 +02:00
Eugene Syromyatnikov d82f931137 syscalls.2: Change example of a thin syscall wrapper to chdir()
As truncate(3) should dispatch between truncate/truncate64,
as noted later in the page.

Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 16:49:42 +02:00
Eugene Syromyatnikov 674cc31493 syscall.2: tfix
Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 16:49:42 +02:00
Michael Kerrisk 3631bd72b2 posix_fadvise.2: Minor tweaks to Eugene Syromyatnikov's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 16:49:39 +02:00
Eugene Syromyatnikov 6c16f22c3d posix_fadvise.2: Describe the difference between fadvise64/fadvise64_64
Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 16:29:11 +02:00
Michael Kerrisk 9b9c895c50 clone.2: Minor fixes to Eugene's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 16:20:48 +02:00
Eugene Syromyatnikov 8016cc9034 clone.2: Add information about clone and clone2 on IA-64
Note that clone() definition on IA-64 is the same as on
SH/Tile/Alpha, align __clone2 declarations in line with the
previous ones, add clone2 syscall prototype.

Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 16:19:20 +02:00
Michael Kerrisk 04b72d20cc keyctl.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-10-14 11:59:10 +02:00
Michael Kerrisk e20f826d8f unshare.2: Minor tweaks to Tycho Andersen's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-29 00:02:44 +02:00
Tycho Andersen 7827e1766e unshare.2: Note EINVAL when unsharing pid ns twice
The kernel doesn't allow unsharing a pid NS if it has previously been
unshared, per this check in copy_pid_ns:

        if (task_active_pid_ns(current) != old_ns)
                return ERR_PTR(-EINVAL);

so let's note that.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-29 00:02:44 +02:00
Michael Kerrisk ad9533eb9e stat.2: ERRORS: ENOENT can occur where a path component is a dangling symlink
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=909789

Reported-by: Alessandro Vesely <vesely@tana.it>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-29 00:02:44 +02:00
Michael Kerrisk 33909153e9 stat.2: Minor fix: split distinct ENOENT cases into separate list entries
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-29 00:02:44 +02:00
Michael Kerrisk 115bbafa8b open.2: Minor fix: split distinct ENOENT cases into separate list entries
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-28 21:48:59 +02:00
Michael Kerrisk 503e378203 epoll_ctl.2: Minor rewording: split a long paragraph
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-16 01:23:15 +02:00
Michael Kerrisk d4dca6b626 fcntl.2: Actual pipe capacity may in practice be less than nominal capacity
The number of bytes that can be written to the pipe may be less
(sometimes substantially less) than the nominal capacity. This
was confirmed with some testing. For example, when writing
4097-byte blocks to a pipe with 65536 byte capacity, only 45066
bytes could be written (i.e., 20470 bytes less than 65536).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-12 17:21:30 +02:00
Michael Kerrisk f957eebd2d clone.2: Clarify the discussion of threads and signals
And explicitly introduce the terms "process-directed" and
"thread-directed" signals.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-10 11:26:34 +02:00
Michael Kerrisk 475c27532a clone.2: Rework discussion of threads and signals
The discussion is phrased in terms of signals send using kill(2),
but applies equally to a signal sent by the kernel.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-10 11:08:31 +02:00
Joseph C. Sible d6d367c7e8 memfd_create.2: _GNU_SOURCE is required
The memfd_create function and its corresponding constants have
required _GNU_SOURCE for as long as they've been in glibc.

Signed-off-by: Joseph C. Sible <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-06 23:24:05 +02:00
Jakub Wilk 46183bb06e mount.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-06 23:18:06 +02:00
Jakub Wilk 85bb10dfc9 connect.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-06 23:17:36 +02:00
Johannes Liebermann 4aa2afed6c reboot.2: Johannes Liebermann <johanan.liebermann@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-09-05 08:52:33 +02:00
Michael Kerrisk 534d8bf8c3 socket.2: Minor tweaks to Tobias Klauser's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-26 13:47:18 +02:00
Tobias Klauser 9eadb32789 socket.2: Document AF_XDP
Document AF_XDP added in Linux 4.18.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-26 13:41:49 +02:00
Michael Kerrisk 55dc41dca7 connect.2: srcfix: rewrap source lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-26 13:41:23 +02:00
Benjamin Peterson 1466257758 connect.2: Document error semantics of nonblocking UNIX domain sockets
connect(2) on a nonblocking UNIX domain socket when the receive
queue is full results in EAGAIN [1]. This is unlike other
connection-based socket families that return EINPROGRESS as
already documented.

mtk: confirmed with some light testing. And in
net/unix/af_unix.c::unix_stream_connect(), we have:

        if (unix_recvq_full(other)) {
                err = -EAGAIN;
                if (!timeo)
                        goto out_unlock;

Signed-off-by: Benjamin Peterson <benjamin@python.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-26 13:35:06 +02:00
Michael Kerrisk fa38cc321f mmap.2: Minor rewording
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-26 13:29:58 +02:00
Elliott Hughes 3ee0a7f07e mmap.2: Explicitly state that the fd can be closed
I regularly see excessive fd usage bugs (or even leaks) caused by
people who think they need to keep the fd open as long as the
mapping exists.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-26 13:14:33 +02:00
Joseph Sible dc9b6c9285 pivot_root.2: Document EINVAL if root is rootfs
Per the comment on the pivot_root syscall in fs/namespace.c:

    Also, the current root cannot be on the 'rootfs'
    (initial ramfs) filesystem.  See
    Documentation/filesystems/ramfs-rootfs-initramfs.txt
    for alternatives in this situation.

Signed-off-by: Joseph C. Sible <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-26 12:08:56 +02:00
Michael Kerrisk b8433813dd wait.2: Add some cross references to core(5)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-21 11:51:09 +02:00
Hiroya Ito 6699401be6 sigaltstack.2: tfix
MINSTKSZ is not defined anywhere, MINSIGSTKSZ seems valid instead.

Signed-off-by: Hiroya Ito <hiroyan@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-21 10:38:47 +02:00
Michael Kerrisk 849971a10c mount.2: Add MS_STRICTATIME to list of flags that can be used in remount
Reported-by: Simone Piccardi <piccardi@truelite.it>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 17:17:06 +02:00
Michael Kerrisk 38ea2e7662 mount.2: Clarify that per-superblock flags are shared during remount
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 17:17:06 +02:00
Michael Kerrisk f66b1d8b2e mount.2: Attempts to change MS_SILENT setting during remount are silently ignored
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 17:17:06 +02:00
Michael Kerrisk 63b0b1a341 mount.2: Clearly distinguish per-mount-point vs per-superblock mount flags
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 17:17:06 +02:00
Michael Kerrisk 2008f97d6f mount.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 17:17:06 +02:00
Michael Kerrisk 182c1e839c mount.2: MS_SILENT is ignored when changing propagation type
MS_SILENT can be specified when changing propagation type,
but is ignored, as far as I can see from reading the code.
(The flags are passed to do_change_type(), which, as well
as the propagation flags, allows MS_REC and MS_SILENT
(in flags_to_propagation_type()), but does noting with
MS_SILENT. (Linux 4.17 source)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 17:17:06 +02:00
Michael Kerrisk 158c5bc0f0 mount.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 17:17:06 +02:00
Michael Kerrisk fca61050bf mount.2: Minor rewording
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 16:04:06 +02:00
Michael Kerrisk 3d17f2f05c mount.2: Remove crufty sentence about MS_BIND + MS_REMOUNT
This sentence is left over from an earlier rewrite of the text,
and the relevant details are covered a few paragraphs later.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 16:04:06 +02:00
Michael Kerrisk e0a21e1338 mount.2: srcfix 2018-08-20 16:04:06 +02:00
Michael Kerrisk fa4c100d8d mount.2: srcfix: update FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 16:04:06 +02:00
Michael Kerrisk a6bfc7571b mount.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 16:04:06 +02:00
Michael Kerrisk 18132fd6f7 mount.2: SEE ALSO: add ioctl_iflags(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 16:04:06 +02:00
Michael Kerrisk 495a1a8988 mount.2: srcfix: add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 16:04:06 +02:00
Michael Kerrisk 41976bc5f3 mount.2: Mandatory locking also now requires CONFIG_MANDATORY_FILE_LOCKING
This is so since Linux 4.5. See the definition of may_mandlock()
in fs/namespace.c.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 16:04:06 +02:00
Michael Kerrisk 054ea65ed8 mount.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 16:04:06 +02:00
Michael Kerrisk e56ab30d61 mount.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 14:45:21 +02:00
Michael Kerrisk 5ea1abf88b mount.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 14:45:21 +02:00
Tobias Klauser 2763b5b0d4 rename.2: Add feature test macro for renameat2()
The glibc wrapper for renameat2() was added in glibc 2.28 and
requires _GNU_SOURCE.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-20 14:45:21 +02:00
Michael Kerrisk a126815556 io_submit.2: Minor tweaks to Adam Manzanares' patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-13 17:07:01 +02:00
Michael Kerrisk 8092a5c8b5 io_submit.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-13 17:04:28 +02:00
Adam Manzanares 5402820052 io_submit.2: Document IOCB_FLAG_IOPRIO
The newly added IOCB_FLAG_IOPRIO aio_flag introduces new behaviors
and return values.

The details of this new feature are posted here:
https://lkml.org/lkml/2018/5/22/809

Signed-off-by: Adam Manzanares <adam.manzanares@wdc.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-13 17:01:14 +02:00
Vince Weaver 43cc0d8ab1 perf_event_open.2: Document the PERF_EVENT_IOC_QUERY_BPF ioctl
The PERF_EVENT_IOC_QUERY_BPF ioctl was introduced in Linux 4.16.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-13 16:27:01 +02:00
Michael Kerrisk 92e696b95d perf_event_open.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-13 16:21:43 +02:00
Vince Weaver 8496491d55 perf_event_open.2: Document the PERF_EVENT_IOC_MODIFY_ATTRIBUTES ioctl
The PERF_EVENT_IOC_MODIFY_ATTRIBUTES ioctl was introduced in
Linux 4.17.  It currently only works on breakpoint events.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-13 16:20:39 +02:00
Vince Weaver 06a61b360b perf_event_open.2: Document the PERF_EVENT_IOC_PAUSE_OUTPUT ioctl
The PERF_EVENT_IOC_PAUSE_OUTPUT ioctl was introduced in Linux 4.7.

I've have this patch for a long time, I apologize for the delay
in getting it submitted.  I've made some minor changes to the
original patch proposed by Wang Nan.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Reviewed-by: Vince Weaver <vincent.weaver@maine.edu>

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-13 16:04:06 +02:00
Vince Weaver 38b581e851 perf_event_open.2: Clarify exclude_idle
It turns out no one is really sure what the perf_event_open.2
exclude_idle field is supposed to do, and a recent thread on the
linux-kernel list:
	[RFC] perf/core: what is exclude_idle supposed to do
did not really clarify things.

I think the following adjustment to the page clarifies things
at least a little.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-13 15:58:14 +02:00
Vince Weaver d134c42971 perf_event_open.2: Fix prctl behavior description
Some discussion on the linux-perf-users list has turned up that
the perf_event_open.2 description of how
PR_TASK_PERF_EVENTS_ENABLE / PR_TASK_PERF_EVENTS_DISABLE prctl()
works is misleading.

The descriptions were based on the tools/perf/design.txt document
which describes behavior that was removed in 082ff5a2767a06 (prior
to 2.6.31, the first release with perf_event_open support).

I have written some tests in my perf_event_tests testsuite that
verifies the behavior of prctl() in this case.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-13 15:50:01 +02:00
Michael Kerrisk 4167f63f52 bpf.2: srcfix: fix typo in kernel version revied for JIT compiler source
Reported-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-09 21:06:52 +02:00
Michael Kerrisk 6d2ac026e8 bpf.2: Minor tweaks to Tobias Klauser's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-09 15:49:18 +02:00
Tobias Klauser c3a428409a bpf.2: Update JIT support list for Linux 4.18
JIT support for x86-32 was during the Linux 4.18 release cycle.
Also correct the entry for MIPS (only MIPS64 is supported).

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-09 15:43:08 +02:00
Michael Kerrisk b94a87a5b8 vmsplice.2: Minor tweaks to Andrei's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-07 14:34:28 +02:00
Andrei Vagin dc7b1aaba0 vmsplice.2: Note that vmsplice can splice pages from pipe to memory
The man page notes that vmsplice() can splice pages from memory
to a pipe, but it can work in the other direction as well.

Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-07 14:30:16 +02:00
Tobias Klauser 80a122fc81 rename.2: renameat2() now has a glibc wrapper; remove mention of syscall(2)
The glibc wrapper was added in glibc 2.28

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-06 21:42:27 +02:00
Tobias Klauser a56f7ab394 statx.2: statx() now has a glibc wrapper; remove mention of syscall(2)
The glibc wrapper was added in glibc 2.28

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-06 21:42:04 +02:00
Lucas De Marchi 6971614d3b memfd_create.2: Fix header for memfd_create()
sys/memfd.h doesn't exist. memfd_create() is declared in
sys/mman.h and some flags are available only in linux/memfd.h.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-04 12:34:09 +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 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 c36ac88feb bpf.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-08-03 15:53:03 +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 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 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 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 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 400388b54b seccomp.2: wfix (to make it clearer at that seccomp affects threads)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-11 08:17:30 +02:00
Michael Kerrisk 86ce931e7c recv.2: wfix: s/data were/data was/
Majority usage in English sometime ago decided that "data" is
a singular noun.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-10 07:14:50 +02:00
Michael Kerrisk 422c110ccb keyctl.2: srcfix: add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-07-02 15:05:12 +02:00
Michael Kerrisk 590ba7e5d0 open_by_handle_at.2, ctermid.3, getcwd.3, proc.5: Wording fix: prefer "pathname" over "path" 2018-06-26 06:47:26 +02:00
Michael Kerrisk f6d844a916 epoll_ctl.2: Minor wording improvements
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-22 12:36:53 +02:00
Michael Kerrisk a16ce618a8 epoll_ctl.2: Use the term "interest list" consistently
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-22 12:34:53 +02:00
Michael Kerrisk fc9294cb6f epoll_wait.2: Note that epoll_wait() round robins through the set of ready descriptors
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-22 12:20:25 +02:00
Michael Kerrisk e3a60d1ce2 epoll_wait.2: Clarify the behavior when epoll_wait()-ing on an empty interest list
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-22 12:20:25 +02:00
Mihir Mehta 4f4b395de2 pread.2: wfix
Fix a typographical error

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-21 19:27:54 +02:00
Michael Kerrisk be914947a7 select.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-12 06:01:32 +02:00
Michael Kerrisk 4c974cbac6 select.2: BUGS: the use of value-result arguments is a design bug
The use of value-result arguments is a design bug that is
not suffered by poll(2).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-01 09:08:28 +02:00
Michael Kerrisk 8b5bbcfabc open.2: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Lucas Werkmeister 71b12d0a57 open.2: Document ENXIO for sockets
Linux returns ENXIO when attempting to open() a UNIX domain socket.
Kernel-wise, I believe this happens in fs/inode.c [1], where a constant
`no_open` function returning -ENXIO is registered as the default open()
handler for inodes in inode_init_always(), and is not specialized in
nit_special_inode() as it is for other types.

Seen in the systemd v238 source code [2].

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/inode.c?h=v4.16
[2]: https://github.com/systemd/systemd/blob/v238/src/core/execute.c#L412

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Michael Kerrisk 6a4c997189 pkey_alloc.2: Switch to glibc prototype in SYNOPSIS
In the kernel, the type of the arguments to pkey_alloc() is
"unsigned long" and that's what the page documented until now.
Now that glibc support is added for pkey_alloc(), switch to the
glibc prototype, which uses "unsigned int".

Reported-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Jakub Wilk f9d9ad2163 setns.2: tfix
Remove duplicated word.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 07:58:06 +02:00
Michael Kerrisk dd08fccaae prctl.2: Add kernel version for PR_GET_SPECULATION_CTRL + PR_SET_SPECULATION_CTRL
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 13:52:41 +02:00
Michael Kerrisk a01c1cbcc3 prctl.2: Various fixups to Konrad Rzeszutek Wilk's text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 13:50:07 +02:00
Michael Kerrisk 2feab5d3b1 prctl.2: Minor fixups
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 12:57:30 +02:00
Michael Kerrisk ac3756bc53 prctl.2: srcfix: rewrap source lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 12:57:30 +02:00
Michael Kerrisk e36dfb8186 prctl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 12:57:30 +02:00
Konrad Rzeszutek Wilk e23acd79f9 prctl.2: Document PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 11:59:26 +02:00
Goldwyn Rodrigues ebf120124b write.2: Partial direct I/O writes
Direct writes can perform partial writes because large writes
can be broken into smaller chunks by the block layer. Part of
the I/O submitted can fail and the failure is returned to write
as an error in the return value. However, part of the write can
be successful which means that data at the offset is inconsistent.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 11:34:34 +02:00
Michael Kerrisk e795580f53 select.2: Note that select() and pselect() are not affected by O_NONBLOCK
Reported-by: Robin Kuzmin <kuzmin.robin@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 11:01:16 +02:00