blob: 8bf12df6270423af3de9f6a3b9c62bba69387f3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
.\" $OpenBSD: pread.3,v 1.2 1999/03/10 10:04:41 d Exp $
.Dd September 7, 1998
.Os
.Dt PREAD 3
.Sh NAME
.Nm pread
.Nd atomic seek and read
.Sh SYNOPSIS
.Fd #include <pthread.h>
.Ft ssize_t
.Fn pread "int filedes" "void *buf" "size_t nbytes" "off_t offset"
.Sh DESCRIPTION
The
.Fn pread
function reads
.Fa nbyte
bytes from offset
.Fa offset
in the file opened on file descriptor
.Fa filedes.
.Pp
This function is provided for use in a threaded, parallel I/O
environment, where race conditions may exist between two threads
non-atomically seeking and reading from the same file descriptor.
.Sh RETURN VALUES
The
.Fn pread
function returns values identical to
.Xr read 3 .
.Sh SEE ALSO
.Xr pthreads 3 ,
.Xr read 3 ,
.Xr pwrite 3
.Sh STANDARDS
.Fn pread
conforms to TOG SUSv2 .
|