Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ seek(II) — UNIX 6th Edition

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

open (II)

creat (II)

SEEK(II)  −  PWB/UNIX 8/5/73

NAME

seek − move read/write pointer

SYNOPSIS

(seek = 19.) 
(file descriptor in r0)
sys seek; offset; ptrname seek(fildes, offset, ptrname)

DESCRIPTION

The file descriptor refers to a file open for reading or writing.  The read (resp. write) pointer for the file is set as follows:

if ptrname is 0, the pointer is set to offset. 

if ptrname is 1, the pointer is set to its current location plus offset. 

if ptrname is 2, the pointer is set to the size of the file plus offset. 

if ptrname is 3, 4 or 5, the meaning is as above for 0, 1 and 2 except that the offset is multiplied by 512. 

If ptrname is 0 or 3, offset is unsigned, otherwise it is signed. 

SEE ALSO

open (II), creat (II)

DIAGNOSTICS

The error bit (c-bit) is set for an undefined file descriptor.  From C, a −1 return indicates an error. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026