posix_fadvise.2, pread.2, readahead.2, sync_file_range.2, truncate.2: Refer to syscall(2) for ABI semantics on certain 32-bit architectures

Also: in sync_file_range.2 and posix_fadvise.2 remove description
of conventional calling signature as flawed, and in
posix_fadvise.2, de-emphasize focus on ARM, and rather phrase
as a more general discussion of certain architectures.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2013-04-01 09:34:30 +02:00
parent bed6b26e9f
commit 63ec43ae07
5 changed files with 44 additions and 17 deletions

View File

@ -25,7 +25,7 @@
.\" 2005-04-08 mtk, noted kernel version and added BUGS .\" 2005-04-08 mtk, noted kernel version and added BUGS
.\" 2010-10-09, mtk, document arm_fadvise64_64() .\" 2010-10-09, mtk, document arm_fadvise64_64()
.\" .\"
.TH POSIX_FADVISE 2 2010-10-09 "Linux" "Linux Programmer's Manual" .TH POSIX_FADVISE 2 2013-04-01 "Linux" "Linux Programmer's Manual"
.SH NAME .SH NAME
posix_fadvise \- predeclare an access pattern for file data posix_fadvise \- predeclare an access pattern for file data
.SH SYNOPSIS .SH SYNOPSIS
@ -151,18 +151,25 @@ call
or or
.BR fdatasync (2) .BR fdatasync (2)
first. first.
.SS arm_fadvise() .SS Architecture-specific variants
The ARM architecture Some architectures require
needs 64-bit arguments to be aligned in a suitable pair of registers. 64-bit arguments to be aligned in a suitable pair of registers (see
On this architecture, the call signature of .BR syscall (2)
for further detail).
On such architectures, the call signature of
.BR posix_fadvise () .BR posix_fadvise ()
is flawed, since it forces a register to be wasted as padding between the shown in the SYNOPSIS would force
a register to be wasted as padding between the
.I fd .I fd
and and
.I len .I len
arguments. arguments.
Therefore, since Linux 2.6.14, ARM defines a different Therefore, these architectures define a version of the
system call that orders the arguments suitably: system call that orders the arguments suitably,
but otherwise is otherwise exactly the same as
.BR posix_fadvise ().
For example, since Linux 2.6.14, ARM has the following system call:
.PP .PP
.in +4n .in +4n
.nf .nf
@ -171,10 +178,11 @@ system call that orders the arguments suitably:
.fi .fi
.in .in
.PP .PP
The behavior of this system call is otherwise exactly the same as These architecture-specific details are generally
.BR posix_fadvise (). hidden from applications by the glibc
No library support is provided for this system call in glibc. .BR posix_fadvise ()
.\" No ARM support in glibc. wrapper function,
which invokes the appropriate architecture-specific system call.
.SH BUGS .SH BUGS
In kernels before 2.6.6, if In kernels before 2.6.6, if
.I len .I len

View File

@ -22,7 +22,7 @@
.\" the source, must acknowledge the copyright and authors of this work. .\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END .\" %%%LICENSE_END
.\" .\"
.TH PREAD 2 2012-04-30 "Linux" "Linux Programmer's Manual" .TH PREAD 2 2013-04-01 "Linux" "Linux Programmer's Manual"
.SH NAME .SH NAME
pread, pwrite \- read from or write to a file descriptor at a given offset pread, pwrite \- read from or write to a file descriptor at a given offset
.SH SYNOPSIS .SH SYNOPSIS
@ -130,6 +130,11 @@ The glibc
and and
.BR pwrite () .BR pwrite ()
wrapper functions transparently deal with the change. wrapper functions transparently deal with the change.
On some 32-bit architectures,
the calling signature for these system calls differ,
for the reasons described in
.BR syscall (2).
.SH BUGS .SH BUGS
POSIX requires that opening a file with the POSIX requires that opening a file with the
.BR O_APPEND .BR O_APPEND

View File

@ -25,7 +25,7 @@
.\" 2004-05-40 Created by Michael Kerrisk <mtk.manpages@gmail.com> .\" 2004-05-40 Created by Michael Kerrisk <mtk.manpages@gmail.com>
.\" 2004-10-05 aeb, minor correction .\" 2004-10-05 aeb, minor correction
.\" .\"
.TH READAHEAD 2 2010-09-10 "Linux" "Linux Programmer's Manual" .TH READAHEAD 2 2013-04-01 "Linux" "Linux Programmer's Manual"
.SH NAME .SH NAME
readahead \- perform file readahead into page cache readahead \- perform file readahead into page cache
.SH SYNOPSIS .SH SYNOPSIS
@ -89,6 +89,11 @@ The
.BR readahead () .BR readahead ()
system call is Linux-specific, and its use should be avoided system call is Linux-specific, and its use should be avoided
in portable applications. in portable applications.
.SH NOTES
On some 32-bit architectures,
the calling signature for this system call differs,
for the reasons described in
.BR syscall (2).
.SH SEE ALSO .SH SEE ALSO
.BR lseek (2), .BR lseek (2),
.BR madvise (2), .BR madvise (2),

View File

@ -27,7 +27,7 @@
.\" Andrew Morton's comments in fs/sync.c .\" Andrew Morton's comments in fs/sync.c
.\" 2010-10-09, mtk, Document sync_file_range2() .\" 2010-10-09, mtk, Document sync_file_range2()
.\" .\"
.TH SYNC_FILE_RANGE 2 2010-10-09 "Linux" "Linux Programmer's Manual" .TH SYNC_FILE_RANGE 2 2013-04-01 "Linux" "Linux Programmer's Manual"
.SH NAME .SH NAME
sync_file_range \- sync a file segment with disk sync_file_range \- sync a file segment with disk
.SH SYNOPSIS .SH SYNOPSIS
@ -186,11 +186,15 @@ need 64-bit arguments to be aligned in a suitable pair of registers.
.\" See kernel commit edd5cd4a9424f22b0fa08bef5e299d41befd5622 .\" See kernel commit edd5cd4a9424f22b0fa08bef5e299d41befd5622
On such architectures, the call signature of On such architectures, the call signature of
.BR sync_file_range () .BR sync_file_range ()
is flawed, since it forces a register to be wasted as padding between the shown in the SYNOPSIS would force
a register to be wasted as padding between the
.I fd .I fd
and and
.I offset .I offset
arguments. arguments.
(See
.BR syscall (2)
for details.)
Therefore, these architectures define a different Therefore, these architectures define a different
system call that orders the arguments suitably: system call that orders the arguments suitably:
.PP .PP

View File

@ -40,7 +40,7 @@
.\" Modified 2002-04-06 by Andries Brouwer <aeb@cwi.nl> .\" Modified 2002-04-06 by Andries Brouwer <aeb@cwi.nl>
.\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com> .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
.\" .\"
.TH TRUNCATE 2 2011-09-08 "Linux" "Linux Programmer's Manual" .TH TRUNCATE 2 2013-04-01 "Linux" "Linux Programmer's Manual"
.SH NAME .SH NAME
truncate, ftruncate \- truncate a file to a specified length truncate, ftruncate \- truncate a file to a specified length
.SH SYNOPSIS .SH SYNOPSIS
@ -240,6 +240,11 @@ system calls that handle large files.
However, these details can be ignored by applications using glibc, whose However, these details can be ignored by applications using glibc, whose
wrapper functions transparently employ the more recent system calls wrapper functions transparently employ the more recent system calls
where they are available. where they are available.
On some 32-bit architectures,
the calling signature for these system calls differ,
for the reasons described in
.BR syscall (2).
.SH BUGS .SH BUGS
A header file bug in glibc 2.12 meant that the minimum value of A header file bug in glibc 2.12 meant that the minimum value of
.\" http://sourceware.org/bugzilla/show_bug.cgi?id=12037 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=12037