summaryrefslogtreecommitdiff
path: root/man/2/sys-seek
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
commit46439007cf417cbd9ac8049bb4122c890097a0fa (patch)
tree6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /man/2/sys-seek
parent37da2899f40661e3e9631e497da8dc59b971cbd0 (diff)
20060303-partial
Diffstat (limited to 'man/2/sys-seek')
-rw-r--r--man/2/sys-seek48
1 files changed, 48 insertions, 0 deletions
diff --git a/man/2/sys-seek b/man/2/sys-seek
new file mode 100644
index 00000000..15124007
--- /dev/null
+++ b/man/2/sys-seek
@@ -0,0 +1,48 @@
+.TH SYS-SEEK 2
+.SH NAME
+seek \- change file offset
+.SH SYNOPSIS
+.EX
+include "sys.m";
+sys := load Sys Sys->PATH;
+
+seek: fn(fd: ref FD, off: big, start: int): big;
+.EE
+.SH DESCRIPTION
+.B Seek
+sets the 64-bit offset for the file
+associated with
+.I fd
+as follows:
+.IP
+If
+.I start
+is
+.BR Sys->SEEKSTART ,
+the offset is set to
+.I off
+bytes.
+.IP
+If
+.I start
+is
+.BR Sys->SEEKRELA ,
+the pointer is set to its current location plus
+.IR off .
+.IP
+If
+.I start
+is
+.BR Sys->SEEKEND ,
+the pointer is set to the size of the
+file plus
+.IR off .
+.PP
+The new file offset value is returned.
+.PP
+Seeking in a pipe is not allowed.
+Seeking in a directory is allowed only if the new offset is zero.
+.SH SEE ALSO
+.IR sys-intro (2),
+.IR sys-open (2),
+.IR bufio (2),