]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
Merge branch 'master' of ra.kernel.org:/pub/scm/docs/man-pages/man-pages
authorMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 9 Jan 2019 18:01:44 +0000 (07:01 +1300)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 9 Jan 2019 18:01:44 +0000 (07:01 +1300)
man2/getgid.2
man2/getpid.2
man2/getuid.2
man2/open.2
man2/pipe.2
man2/rename.2
man2/syscall.2

index ba8f376fb6220e2efe7aa491421c2a083e6bf837..137d633a41a960aeeeadeb60ed17ecde7e22545f 100644 (file)
@@ -59,6 +59,20 @@ The glibc
 and
 .BR getegid ()
 wrapper functions transparently deal with the variations across kernel versions.
+.PP
+On Alpha, instead of a pair of
+.BR getgid "() and " getegid ()
+system calls, a single
+.BR getxgid ()
+system call is provided, which returns a pair of real and effective GIDs.
+The glibc
+.BR getgid ()
+and
+.BR getegid ()
+wrapper functions transparently deal with this.
+See
+.BR syscall (2)
+for details regarding register mapping.
 .SH SEE ALSO
 .BR getresgid (2),
 .BR setgid (2),
index cddde079cdda5d66809c11da8c1530de9f13f03b..ed6e7726404ed659eaecb620603f6f27b2860bf9 100644 (file)
@@ -136,6 +136,20 @@ calls to
 always invoke the actual system call, rather than returning a cached value.
 .\" FIXME .
 .\" Review progress of https://bugzilla.redhat.com/show_bug.cgi?id=1469757
+.PP
+On Alpha, instead of a pair of
+.BR getpid "() and " getppid ()
+system calls, a single
+.BR getxpid ()
+system call is provided, which returns a pair of PID and parent PID.
+The glibc
+.BR getpid ()
+and
+.BR getppid ()
+wrapper functions transparently deal with this.
+See
+.BR syscall (2)
+for details regarding register mapping.
 .SH SEE ALSO
 .BR clone (2),
 .BR fork (2),
index 61f5fa1ef9d36b09bebb9c42c90b4cf26da4a5f4..8e80090a243f5685f985c258e2d543fedfded3b6 100644 (file)
@@ -70,6 +70,20 @@ The glibc
 and
 .BR geteuid ()
 wrapper functions transparently deal with the variations across kernel versions.
+.PP
+On Alpha, instead of a pair of
+.BR getuid "() and " geteuid ()
+system calls, a single
+.BR getxuid ()
+system call is provided, which returns a pair of real and effective UIDs.
+The glibc
+.BR getuid ()
+and
+.BR geteuid ()
+wrapper functions transparently deal with this.
+See
+.BR syscall (2)
+for details regarding register mapping.
 .SH SEE ALSO
 .BR getresuid (2),
 .BR setreuid (2),
index f38e1c1e0a520125f4050bb7608caca2accdb813..22c98855e32331f335a7051a54a9e6c17ce8febf 100644 (file)
@@ -1314,10 +1314,18 @@ directory show the open file descriptors of the process with the PID
 .IR pid .
 The files in the
 .I /proc/[pid]/fdinfo
-directory show even more information about these files descriptors.
+directory show even more information about these file descriptors.
 See
 .BR proc (5)
 for further details of both of these directories.
+.PP
+The Linux header file
+.B <asm/fcntl.h>
+doesn't define
+.BR O_ASYNC ;
+the (BSD-derived)
+.B FASYNC
+synonym is defined instead.
 .\"
 .\"
 .SS Open file descriptions
@@ -1378,10 +1386,14 @@ and
 .BR O_DSYNC ,
 but not
 .BR O_RSYNC .
-(Somewhat incorrectly, glibc defines
+Somewhat incorrectly, glibc defines
 .BR O_RSYNC
 to have the same value as
-.BR O_SYNC .)
+.BR O_SYNC .
+.RB ( O_RSYNC
+is defined in the Linux header file
+.I <asm/fcntl.h>
+on HP PA-RISC, but it is not used.)
 .PP
 .BR O_SYNC
 provides synchronized I/O
index fcae8c0ab3b524fea24dfbdd45e50f1336feb9bc..d265a8d8ecae59758b6924094acb29f904cf3c39 100644 (file)
@@ -40,6 +40,13 @@ pipe, pipe2 \- create pipe
 .nf
 .B #include <unistd.h>
 .PP
+/* On Alpha, IA-64, MIPS, SuperH, and SPARC/SPARC64; see NOTES */
+.B struct fd_pair {
+.B "    long fd[2];"
+.B "};"
+.B struct fd_pair pipe();
+.PP
+/* On all other architectures */
 .BI "int pipe(int " pipefd "[2]);"
 
 .BR "#define _GNU_SOURCE" "             /* See feature_test_macros(7) */"
@@ -184,6 +191,23 @@ has been reached and the caller is not privileged; see
 was added to Linux in version 2.6.27;
 glibc support is available starting with
 version 2.9.
+.SH NOTES
+.\" See http://math-atlas.sourceforge.net/devel/assembly/64.psabi.1.33.ps.Z
+.\" for example, section 3.2.1 "Registers and the Stack Frame".
+The SystemV ABI on some architectures allows the use of more than one register
+for returning multiple values; several architectures
+(namely, Alpha, IA-64, MIPS, SuperH, and SPARC/SPARC64)
+(ab)use this feature in order to implement the
+.BR pipe ()
+system call in a functional manner:
+the call doesn't take any arguments and returns
+a pair of file descriptors as the return value on success.
+The glibc
+.BR pipe ()
+wrapper function transparently deals with this.
+See
+.BR syscall (2)
+for information regarding registers used for storing second file descriptor.
 .SH CONFORMING TO
 .BR pipe ():
 POSIX.1-2001, POSIX.1-2008.
index 8f06d52b667e883576274fe0bfc4289bbf3a9a49..05f001278aa5b2c794d70cbcc7a928cbfd49fd76 100644 (file)
@@ -267,6 +267,14 @@ The whole operation needs to be done atomically.
 .IP
 When not part of a union/overlay,
 the whiteout appears as a character device with a {0,0} device number.
+.\" https://www.freebsd.org/cgi/man.cgi?query=mount_unionfs&manpath=FreeBSD+11.0-RELEASE
+(Note that other union/overlay implementations may employ different methods
+for storing whiteout entries; specifically, BSD union mount employs
+a separate inode type,
+.BR DT_WHT ,
+which, while supported by some filesystems available in Linux,
+such as CODA and XFS, is ignored by the kernel's whiteout support code,
+as of Linux 4.19, at least.)
 .IP
 .B RENAME_WHITEOUT
 requires the same privileges as creating a device node (i.e., the
@@ -284,8 +292,14 @@ tmpfs (since Linux 3.18),
 .\" tmpfs: commit 46fdb794e3f52ef18b859ebc92f0a9d7db21c5df
 ext4 (since Linux 3.18),
 .\" ext4: commit cd808deced431b66b5fa4e5c193cb7ec0059eaff
-and XFS (since Linux 4.1).
+XFS (since Linux 4.1),
 .\" XFS: commit 7dcf5c3e4527cfa2807567b00387cf2ed5e07f00
+f2fs (since Linux 4.2).
+.\" f2fs: commit 7e01e7ad746bc8198a8b46163ddc73a1c7d22339
+btrfs (since Linux 4.7),
+.\" btrfs: commit cdd1fedf8261cd7a73c0596298902ff4f0f04492
+and ubifs (since Linux 4.9).
+.\" ubifs: commit 9e0a1fff8db56eaaebb74b4a3ef65f86811c4798
 .SH RETURN VALUE
 On success, zero is returned.
 On error, \-1 is returned, and
index 11e14167cb01e537250e75afd57960a1f5ebfaac..77e6bccddd5077e513abf6706d7e3fb02dbf32f1 100644 (file)
@@ -172,43 +172,43 @@ The first table lists the instruction used to transition to kernel mode
 so you might have to refer to
 .BR vdso (7)),
 the register used to indicate the system call number,
-the register used to return the system call result,
+the register(s) used to return the system call result,
 and the register used to signal an error.
 .if t \{\
 .ft CW
 \}
 .TS
-l2     l2      l2      l2      l2      l.
-arch/ABI       instruction     syscall #       retval  error   Notes
+l2     l2      l2      l2      l1      l2      l.
+Arch/ABI       Instruction     System  Ret     Ret     Error   Notes
+               call #  val     val2
 _
-alpha  callsys v0      v0      a3      [1]
-arc    trap0   r8      r0      -
-arm/OABI       swi NR  -       a1      -       [2]
-arm/EABI       swi 0x0 r7      r0      -
-arm64  svc #0  x8      x0      -
-blackfin       excpt 0x0       P0      R0      -
-i386   int $0x80       eax     eax     -
-ia64   break 0x100000  r15     r8      r10     [1]
-m68k   trap #0 d0      d0      -
-microblaze     brki r14,8      r12     r3      -
-mips   syscall v0      v0      a3      [1]
-nios2  trap    r2      r2      r7
-parisc ble 0x100(%sr2, %r0)    r20     r28     -
-powerpc        sc      r0      r3      r0      [1]
-riscv  scall   a7      a0      -
-s390   svc 0   r1      r2      -       [3]
-s390x  svc 0   r1      r2      -       [3]
-superh trap #0x17      r3      r0      -       [4]
-sparc/32       t 0x10  g1      o0      psr/csr [1]
-sparc/64       t 0x6d  g1      o0      psr/csr [1]
-tile   swint1  R10     R00     R01     [1]
-x86-64 syscall rax     rax     -       [5]
-x32    syscall rax     rax     -       [5]
-xtensa syscall a2      a2      -
+alpha  callsys v0      v0      a4      a3      1, 6
+arc    trap0   r8      r0      -       -
+arm/OABI       swi NR  -       a1      -       -       2
+arm/EABI       swi 0x0 r7      r0      r1      -
+arm64  svc #0  x8      x0      x1      -
+blackfin       excpt 0x0       P0      R0      -       -
+i386   int $0x80       eax     eax     edx     -
+ia64   break 0x100000  r15     r8      r9      r10     1, 6
+m68k   trap #0 d0      d0      -       -
+microblaze     brki r14,8      r12     r3      -       -
+mips   syscall v0      v0      v1      a3      1, 6
+nios2  trap    r2      r2      -       r7
+parisc ble 0x100(%sr2, %r0)    r20     r28     -       -
+powerpc        sc      r0      r3      -       r0      1
+riscv  scall   a7      a0      a1      -
+s390   svc 0   r1      r2      r3      -       3
+s390x  svc 0   r1      r2      r3      -       3
+superh trap #0x17      r3      r0      r1      -       4, 6
+sparc/32       t 0x10  g1      o0      o1      psr/csr 1, 6
+sparc/64       t 0x6d  g1      o0      o1      psr/csr 1, 6
+tile   swint1  R10     R00     -       R01     1
+x86-64 syscall rax     rax     rdx     -       5
+x32    syscall rax     rax     rdx     -       5
+xtensa syscall a2      a2      -       -
 .TE
 .PP
 Notes:
-.RS 4
 .IP [1] 4
 On a few architectures,
 a register is used as a boolean
@@ -279,6 +279,21 @@ but passes an 8-byte
 .I pos
 argument in a single register and not two, as is done in every other ABI.
 .RE
+.IP [6]
+Some architectures
+(namely, Alpha, IA-64, MIPS, SuperH, sparc/32, and sparc/64)
+use an additional register ("Retval2" in the above table)
+to pass back a second return value from the
+.BR pipe (2)
+system call;
+Alpha uses this technique in the architecture-specific
+.BR getxpid (2),
+.BR getxuid (2),
+and
+.BR getxgid (2)
+system calls as well.
+Other architectures do not use the second return value register
+in the system call interface, even if it is defined in the System V ABI.
 .if t \{\
 .in
 .ft P
@@ -290,7 +305,7 @@ The second table shows the registers used to pass the system call arguments.
 \}
 .TS
 l      l2      l2      l2      l2      l2      l2      l2      l.
-arch/ABI       arg1    arg2    arg3    arg4    arg5    arg6    arg7    Notes
+Arch/ABI       arg1    arg2    arg3    arg4    arg5    arg6    arg7    Notes
 _
 alpha  a0      a1      a2      a3      a4      a5      -
 arc    r0      r1      r2      r3      r4      r5      -
@@ -302,7 +317,7 @@ i386        ebx     ecx     edx     esi     edi     ebp     -
 ia64   out0    out1    out2    out3    out4    out5    -
 m68k   d1      d2      d3      d4      d5      a0      -
 microblaze     r5      r6      r7      r8      r9      r10     -
-mips/o32       a0      a1      a2      a3      -       -       -       [1]
+mips/o32       a0      a1      a2      a3      -       -       -       1
 mips/n32,64    a0      a1      a2      a3      a4      a5      -
 nios2  r4      r5      r6      r7      r8      r9      -
 parisc r26     r25     r24     r23     r22     r21     -
@@ -320,11 +335,9 @@ xtensa     a6      a3      a4      a5      a8      a9      -
 .TE
 .PP
 Notes:
-.RS 4
 .IP [1] 4
 The mips/o32 system call convention passes
 arguments 5 through 8 on the user stack.
-.RE
 .if t \{\
 .in
 .ft P