mirror of https://github.com/mkerrisk/man-pages
syscall.2: Minor fix-ups to Changhee Han's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
638fd4bfda
commit
9525301640
|
@ -37,7 +37,7 @@
|
|||
.\" 2002-03-20 Christoph Hellwig <hch@infradead.org>
|
||||
.\" - adopted for Linux
|
||||
.\"
|
||||
.TH SYSCALL 2 2012-08-14 "Linux" "Linux Programmer's Manual"
|
||||
.TH SYSCALL 2 2013-04-01 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
syscall \- indirect system call
|
||||
.SH SYNOPSIS
|
||||
|
@ -80,8 +80,11 @@ and an error code is stored in
|
|||
first appeared in
|
||||
4BSD.
|
||||
|
||||
Each architecture ABI has its own requirements on how system call arguments are passed to the kernel.
|
||||
For system calls that have a glibc wrapper (i.g., most system calls) glibc handles the details of copy arguments to the right registers in a manner suitable for the architecture.
|
||||
Each architecture ABI has its own requirements on how
|
||||
system call arguments are passed to the kernel.
|
||||
For system calls that have a glibc wrapper (e.g., most system calls),
|
||||
glibc handles the details of copyiing arguments to the right registers
|
||||
in a manner suitable for the architecture.
|
||||
However, when using
|
||||
.BR syscall ()
|
||||
to make a system call,
|
||||
|
@ -90,25 +93,24 @@ For example, on ARM architecture, a
|
|||
.I "long long"
|
||||
argument is considered to be 8-byte aligned and to be split into two 4-byte arguments.
|
||||
|
||||
For example, the
|
||||
.BR readahead ()
|
||||
system call could be called like below in ARM architecture.
|
||||
|
||||
syscall(__NR_readahead, fd,
|
||||
.I 0
|
||||
, (unsigned int)(
|
||||
.I offset
|
||||
>> 32), (unsigned int)(
|
||||
.I offset
|
||||
& 0xFFFFFFFF), count)
|
||||
system call would be invoked as follows on the ARM architecture:
|
||||
|
||||
.in +4n
|
||||
.nf
|
||||
syscall(__NR_readahead, fd, 0, (unsigned int)(offset >> 32),
|
||||
(unsigned int)(offset & 0xFFFFFFFF), count);
|
||||
.fi
|
||||
.in
|
||||
.PP
|
||||
.I offset
|
||||
is 64 bit and should be 8-byte aligned.
|
||||
Thus, a padding is inserted before
|
||||
.I offset
|
||||
and
|
||||
.I offset
|
||||
is split into two 32 bit arguments.
|
||||
|
||||
is split into two 32-bit arguments.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#define _GNU_SOURCE
|
||||
|
|
Loading…
Reference in New Issue