ftruncate(2) DG/UX 4.30 ftruncate(2)
NAME
ftruncate - Truncate a file.
SYNOPSIS
int ftruncate (fildes, length)
int fildes;
long length;
PARAMETERS
fildes A valid, active file descriptor.
length Maximum length of file after truncation.
DESCRIPTION
This call is similar to the truncate system call, except
that ftruncate takes a file descriptor instead of a pathname
to identify the file.
Otherwise, the semantics of this call are identical to those
of truncate.
ACCESS CONTROL
<Fildes> must be open for writing.
RETURN VALUE
0 The file was successfully truncated.
-1 An error occurred. Errno is set to indicate
the error.
EXCEPTIONS
Errno may be set to one of the following error codes:
EBADF <Fildes> is not a valid, active descriptor.
EINVAL <Fildes> is not open for writing.
EINVAL <Fildes> references a socket, not a file.
EINTR Fcntl was interrupted while waiting for a
lock.
SEE ALSO
The related manual sections: creat(2), open(2),
truncate(2).
Licensed material--property of copyright holder(s) Page 1