diff options
Diffstat (limited to 'lib/libc/sys/read.2')
| -rw-r--r-- | lib/libc/sys/read.2 | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/lib/libc/sys/read.2 b/lib/libc/sys/read.2 index 42d04ce87337..fc7d002c0c5a 100644 --- a/lib/libc/sys/read.2 +++ b/lib/libc/sys/read.2 @@ -53,21 +53,27 @@ .Ft ssize_t .Fn pread "int d" "void *buf" "size_t nbytes" "off_t offset" .Sh DESCRIPTION -.Fn Read +The +.Fn read +system call attempts to read .Fa nbytes of data from the object referenced by the descriptor .Fa d into the buffer pointed to by .Fa buf . -.Fn Readv +The +.Fn readv +system call performs the same action, but scatters the input data into the .Fa iovcnt buffers specified by the members of the .Fa iov array: iov[0], iov[1], ..., iov[iovcnt\|\-\|1]. -.Fn Pread +The +.Fn pread +system call performs the same function, but reads from the specified position in the file without modifying the file pointer. .Pp @@ -88,7 +94,9 @@ Each .Fa iovec entry specifies the base address and length of an area in memory where data should be placed. -.Fn Readv +The +.Fn readv +system call will always fill an area completely before proceeding to the next. .Pp @@ -125,10 +133,12 @@ Otherwise, a -1 is returned and the global variable .Va errno is set to indicate the error. .Sh ERRORS -.Fn Read , +The +.Fn read , .Fn readv , and .Fn pread +system calls will succeed unless: .Bl -tag -width Er .It Bq Er EBADF @@ -178,7 +188,7 @@ points outside the process's allocated address space. .Pp The .Fn pread -call may also return the following errors: +system call may also return the following errors: .Bl -tag -width Er .It Bq Er EINVAL The specified file offset is invalid. @@ -196,26 +206,24 @@ The file descriptor is associated with a pipe, socket, or FIFO. .Sh STANDARDS The .Fn read -function call is expected to conform to +system call is expected to conform to .St -p1003.1-90 . The .Fn readv and .Fn pread -functions are expected to conform to +system calls are expected to conform to .St -xpg4.2 . .Sh HISTORY The .Fn pread -function call -appeared in +function appeared in .At V.4 . The .Fn readv -function call -appeared in +system call appeared in .Bx 4.2 . -A +The .Fn read -function call appeared in +function appeared in .At v6 . |
