1 .\" Copyright (C) 1999 Joseph Samuel Myers.
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .TH PREAD 2 1999-01-21 "Linux 2.2.0-pre9" "Linux Programmer's Manual"
25 pread, pwrite \- read from or write to a file descriptor at a given offset
27 .B #define _XOPEN_SOURCE 500
29 .B #include <unistd.h>
31 .BI "ssize_t pread(int " fd ", void *" buf ", size_t " count ", off_t " offset );
33 .BI "ssize_t pwrite(int " fd ", const void *" buf ", size_t " count ", off_t " offset );
39 bytes from file descriptor
43 (from the start of the file) into the buffer starting at
45 The file offset is not changed.
50 bytes from the buffer starting at
52 to the file descriptor
56 The file offset is not changed.
58 The file referenced by
60 must be capable of seeking.
62 On success, the number of bytes read or written is returned (zero
63 indicates that nothing was written, in the case of \fBpwrite\fR, or
64 end of file, in the case of \fBpread\fR), or \-1 on error, in which
67 is set to indicate the error.
72 to any error specified for \fBread\fR(2) or \fBlseek\fR(2).
76 to any error specified for \fBwrite\fR(2) or \fBlseek\fR(2).
80 The \fBpread\fR and \fBpwrite\fR system calls were added to Linux in
81 version 2.1.60; the entries in the i386 system call table were added
82 in 2.1.69. The libc support (including emulation on older kernels
83 without the system calls) was added in glibc 2.1.