Research V4 development
[unix-history] / man / man2 / seek.2
CommitLineData
88d0a458
KT
1.th SEEK II 8/5/73
2.sh NAME
3seek \*- move read/write pointer
4.sh SYNOPSIS
5(seek = 19.)
6.br
7(file descriptor in r0)
8.ft B
9.br
10sys seek; offset; ptrname
11.s3
12seek(fildes, offset, ptrname)
13.ft R
14.sh DESCRIPTION
15The file
16descriptor refers to a file open for reading or writing.
17The read (resp. write) pointer for the file is set as follows:
18.s3
19.lp +6 3
20if
21.it ptrname
22is 0, the pointer is set to
23.it offset.
24.s3
25.lp +6 3
26if
27.it ptrname
28is 1, the pointer is set to its current location plus
29.it offset.
30.s3
31.lp +6 3
32if
33.it ptrname
34is 2, the pointer is set to the size of the
35file plus
36.it offset.
37.s3
38.lp +6 3
39if
40.it ptrname
41is 3, 4 or 5,
42the meaning is as above for
430, 1 and 2 except that
44the offset is
45multiplied by 512.
46.s3
47.i0
48If
49.it ptrname
50is 0 or 3,
51.it offset
52is unsigned,
53otherwise
54it is signed.
55.sh "SEE ALSO"
56open(II), creat(II)
57.sh DIAGNOSTICS
58The error bit
59(c-bit) is set for an undefined file descriptor.
60From C, a \*-1 return indicates an error.