FreeBSD Bugzilla – Attachment 120031 Details for
Bug 162765
[patch] lseek(2) may return successful although no seek operation was actually performed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.85 KB, created by
Alexander Best
on 2011-11-22 20:40:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Alexander Best
Created:
2011-11-22 20:40:01 UTC
Size:
1.85 KB
patch
obsolete
>diff --git a/lib/libc/sys/lseek.2 b/lib/libc/sys/lseek.2 >index 874c523..209af51 100644 >--- a/lib/libc/sys/lseek.2 >+++ b/lib/libc/sys/lseek.2 >@@ -28,7 +28,7 @@ > .\" @(#)lseek.2 8.3 (Berkeley) 4/19/94 > .\" $FreeBSD$ > .\" >-.Dd April 5, 2007 >+.Dd November 21, 2011 > .Dt LSEEK 2 > .Os > .Sh NAME >@@ -113,10 +113,9 @@ of the existing end-of-file of the file. > If data is later written > at this point, subsequent reads of the data in the gap return > bytes of zeros (until data is actually written into the gap). >-.Pp >-Some devices are incapable of seeking. >-The value of the pointer >-associated with such a device is undefined. >+However, the >+.Fn lseek >+system call does not, by itself, extend the size of a file. > .Pp > A > .Qq hole >@@ -197,13 +196,43 @@ is associated with a pipe, socket, or FIFO. > The > .Fn lseek > system call is expected to conform to >-.St -p1003.1-90 . >+.St -p1003.1-2008 . >+.Pp >+The >+.Dv SEEK_HOLE >+and >+.Dv SEEK_DATA >+directives, along with the >+.Er ENXIO >+error, are extensions to that specification. > .Sh HISTORY > The > .Fn lseek > function appeared in > .At v7 . > .Sh BUGS >+If the >+.Fn lseek >+system call is operating on a device which is incapable of seeking, >+it will request the seek operation and return successfully, >+even though no seek was performed. >+Because the >+.Ar offset >+argument will be stored unconditionally in the file descriptor of that device, >+there is no way to confirm, if the seek operation succeeded or not >+(e.g. using the >+.Fn ftell >+function). >+Device types which are known to be incapable of seeking include >+tape drives. >+.Pp >+The >+.Fn lseek >+system call will not detect whether media are present in changeable >+media devices such as DVD or Blu-ray devices. >+A requested seek operation will therefore return sucessfully when no >+medium is present. >+.Pp > This document's use of > .Fa whence > is incorrect English, but is maintained for historical reasons.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 162765
:
120031
|
120032