mirror of https://github.com/mkerrisk/man-pages
syscall.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
b791f86135
commit
dcc5bd7fbd
|
@ -61,14 +61,14 @@ Employing
|
|||
.BR syscall ()
|
||||
is useful, for example,
|
||||
when invoking a system call that has no wrapper function in the C library.
|
||||
|
||||
.PP
|
||||
.BR syscall ()
|
||||
saves CPU registers before making the system call,
|
||||
restores the registers upon return from the system call,
|
||||
and stores any error code returned by the system call in
|
||||
.BR errno (3)
|
||||
if an error occurs.
|
||||
|
||||
.PP
|
||||
Symbolic constants for system call numbers can be found in the header file
|
||||
.IR <sys/syscall.h> .
|
||||
.SH RETURN VALUE
|
||||
|
@ -92,7 +92,7 @@ However, when using
|
|||
to make a system call,
|
||||
the caller might need to handle architecture-dependent details;
|
||||
this requirement is most commonly encountered on certain 32-bit architectures.
|
||||
|
||||
.PP
|
||||
For example, on the ARM architecture Embedded ABI (EABI), a
|
||||
64-bit value (e.g.,
|
||||
.IR "long long" )
|
||||
|
@ -104,7 +104,7 @@ the
|
|||
.BR readahead ()
|
||||
system call would be invoked as follows on the ARM architecture with the EABI
|
||||
in little endian mode:
|
||||
|
||||
.PP
|
||||
.in +4n
|
||||
.nf
|
||||
syscall(SYS_readahead, fd, 0,
|
||||
|
@ -127,16 +127,16 @@ That means inserting a dummy value into
|
|||
(the second argument of 0).
|
||||
Care also must be taken so that the split follows endian conventions
|
||||
(according to the C ABI for the platform).
|
||||
|
||||
.PP
|
||||
Similar issues can occur on MIPS with the O32 ABI,
|
||||
on PowerPC with the 32-bit ABI, and on Xtensa.
|
||||
.\" Mike Frysinger: this issue ends up forcing MIPS
|
||||
.\" O32 to take 7 arguments to syscall()
|
||||
|
||||
.PP
|
||||
.\" See arch/parisc/kernel/sys_parisc.c.
|
||||
Note that while the parisc C ABI also uses aligned register pairs,
|
||||
it uses a shim layer to hide the issue from userspace.
|
||||
|
||||
.PP
|
||||
The affected system calls are
|
||||
.BR fadvise64_64 (2),
|
||||
.BR ftruncate64 (2),
|
||||
|
@ -147,7 +147,7 @@ The affected system calls are
|
|||
.BR sync_file_range (2),
|
||||
and
|
||||
.BR truncate64 (2).
|
||||
|
||||
.PP
|
||||
.\" You need to look up the syscalls directly in the kernel source to see if
|
||||
.\" they should be in this list. For example, look at fs/read_write.c and
|
||||
.\" the function signatures that do:
|
||||
|
@ -166,7 +166,7 @@ Welcome to the wonderful world of historical baggage.
|
|||
Every architecture has its own way of invoking and passing arguments to the
|
||||
kernel.
|
||||
The details for various architectures are listed in the two tables below.
|
||||
|
||||
.PP
|
||||
The first table lists the instruction used to transition to kernel mode
|
||||
(which might not be the fastest or best way to transition to the kernel,
|
||||
so you might have to refer to
|
||||
|
|
Loading…
Reference in New Issue