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),
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),
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),
.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
.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
.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) */"
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.
.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
.\" 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
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
.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
\}
.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 -
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 -
.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