From 2374c17872a0024d1bcea58fcc0ad423d874608c Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 2 Mar 2006 00:51:08 +0000 Subject: [PATCH] Add a case to the EINVAL error text. Various minor wording fixes --- man2/lseek.2 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/man2/lseek.2 b/man2/lseek.2 index 8c000f5ff..14ccdba0c 100644 --- a/man2/lseek.2 +++ b/man2/lseek.2 @@ -78,16 +78,17 @@ bytes. .PP The .BR lseek () -function allows the file offset to be set beyond the end of the existing -end-of-file of the file (but this does not change the size of the file). +function allows the file offset to be set beyond the end +of the file (but this does not change the size of the file). If data is later written at this point, subsequent reads of the data -in the gap return null bytes ('\\0') until data is actually written into -the gap. +in the gap (a "hole") return null bytes ('\\0') until +data is actually written into the gap. .SH "RETURN VALUE" Upon successful completion, .BR lseek () returns the resulting offset location as measured in bytes from the -beginning of the file. Otherwise, a value of (off_t)\-1 is returned and +beginning of the file. +Otherwise, a value of \fI(off_t)\-1\fP is returned and .I errno is set to indicate the error. .SH ERRORS @@ -98,12 +99,14 @@ is not an open file descriptor. .TP .B EINVAL .I whence -is not one of SEEK_SET, SEEK_CUR, SEEK_END, -or the resulting file offset would be negative. +is not one of SEEK_SET, SEEK_CUR, SEEK_END; +or the resulting file offset would be negative, +or beyond the end of a seekable device. .\" Some systems may allow negative offsets for character devices .\" and/or for remote filesystems. .TP .B EOVERFLOW +.\" HP-UX 11 says EINVAL for this case (but POSIX.1 says EOVERFLOW) The resulting file offset cannot be represented in an .IR off_t . .TP