summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/fcntl.2
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-09-28 16:59:47 +0000
committerdelphij <delphij@FreeBSD.org>2009-09-28 16:59:47 +0000
commit79f2f8c774b48d4ef62f92d4a09e80af3ceaca7c (patch)
tree1cca7c0ea10e2ad0213a1d75a2c8a8fe0061f4d4 /lib/libc/sys/fcntl.2
parentfd5f08e3e82b6caa8a7fff6a32c9e56b9212003e (diff)
downloadFreeBSD-src-79f2f8c774b48d4ef62f92d4a09e80af3ceaca7c.zip
FreeBSD-src-79f2f8c774b48d4ef62f92d4a09e80af3ceaca7c.tar.gz
Add two new fcntls to enable/disable read-ahead:
- F_READAHEAD: specify the amount for sequential access. The amount is specified in bytes and is rounded up to nearest block size. - F_RDAHEAD: Darwin compatible version that use 128KB as the sequential access size. A third argument of zero disables the read-ahead behavior. Please note that the read-ahead amount is also constrainted by sysctl variable, vfs.read_max, which may need to be raised in order to better utilize this feature. Thanks Igor Sysoev for proposing the feature and submitting the original version, and kib@ for his valuable comments. Submitted by: Igor Sysoev <is rambler-co ru> Reviewed by: kib@ MFC after: 1 month
Diffstat (limited to 'lib/libc/sys/fcntl.2')
-rw-r--r--lib/libc/sys/fcntl.218
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/libc/sys/fcntl.2 b/lib/libc/sys/fcntl.2
index a16724c..250cef4 100644
--- a/lib/libc/sys/fcntl.2
+++ b/lib/libc/sys/fcntl.2
@@ -28,7 +28,7 @@
.\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94
.\" $FreeBSD$
.\"
-.Dd March 8, 2008
+.Dd September 28, 2009
.Dt FCNTL 2
.Os
.Sh NAME
@@ -241,6 +241,22 @@ will be interrupted if the signal handler has not specified the
.Dv SA_RESTART
(see
.Xr sigaction 2 ) .
+.It Dv F_READAHEAD
+Set or clear the read ahead amount for sequential access to the third
+argument,
+.Fa arg ,
+which is rounded up to the nearest block size.
+A zero value in
+.Fa arg
+turns off read ahead.
+.It Dv F_RDAHEAD
+Equivalent to Darwin counterpart which sets read ahead amount of 128KB
+when the third argument,
+.Fa arg
+is non-zero.
+A zero value in
+.Fa arg
+turns off read ahead.
.El
.Pp
When a shared lock has been set on a segment of a file,
OpenPOWER on IntegriCloud