Blob
1 .TH SEEK 32 .SH NAME3 seek \- change file offset4 .SH SYNOPSIS5 .B #include <u.h>6 .br7 .B #include <libc.h>8 .PP9 .B10 vlong seek(int fd, vlong n, int type)11 .SH DESCRIPTION12 .I Seek13 sets the offset for the file14 associated with15 .I fd16 as follows:17 .IP18 If19 .I type20 is 0, the offset is set to21 .I n22 bytes.23 .IP24 If25 .I type26 is 1, the pointer is set to its current location plus27 .IR n .28 .IP29 If30 .I type31 is 2, the pointer is set to the size of the32 file plus33 .IR n .34 .PP35 The new file offset value is returned.36 .PP37 Seeking in a directory is not allowed.38 Seeking in a pipe is a no-op.39 .SH SOURCE40 .B /usr/local/plan9/src/libc/9syscall41 .SH SEE ALSO42 .IR intro (3),43 .IR open (3)44 .SH DIAGNOSTICS45 Sets46 .IR errstr .