xref: /original-bsd/share/man/man3f/fseek.3 (revision c3e32dec)
Copyright (c) 1983, 1993
The Regents of the University of California. All rights reserved.

%sccs.include.proprietary.roff%

@(#)fseek.3 8.1 (Berkeley) 06/05/93

FSEEK 3F ""
C 5
NAME
fseek, ftell - reposition a file on a logical unit
SYNOPSIS
integer function fseek (lunit, offset, from)

integer offset, from integer function ftell (lunit)

DESCRIPTION
lunit must refer to an open logical unit. offset is an offset in bytes relative to the position specified by from. Valid values for from are: 0 meaning `beginning of the file'

1 meaning `the current position'

2 meaning `the end of the file'

The value returned by fseek will be 0 if successful, a system error code otherwise. (See perror(3F))

Ftell returns the current position of the file associated with the specified logical unit. The value is an offset, in bytes, from the beginning of the file. If the value returned is negative, it indicates an error and will be the negation of the system error code. (See perror(3F))

FILES
"SEE ALSO"
fseek(3S), perror(3F)