.\" Copyright (c) 1983 The Regents of the University of California.
.\" Redistribution and use in source and binary forms are permitted
.\" provided that the above copyright notice and this paragraph are
.\" duplicated in all such forms and that any documentation,
.\" advertising materials, and other materials related to such
.\" distribution and use acknowledge that the software was developed
.\" by the University of California, Berkeley. The name of the
.\" University may not be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\" @(#)truncate.2 6.7 (Berkeley) %G%
truncate \- truncate a file to a specified length
to be truncated to at most
bytes in size. If the file previously
was larger than this size, the extra data
the file must be open for writing.
A value of 0 is returned if the call succeeds. If the call
fails a \-1 is returned, and the global variable \fIerrno\fP
A component of the path prefix is not a directory.
The pathname contains a character with the high-order bit set.
A component of a pathname exceeded 255 characters,
or an entire path name exceeded 1023 characters.
The named file does not exist.
Search permission is denied for a component of the path prefix.
The named file is not writable by the user.
Too many symbolic links were encountered in translating the pathname.
The named file is a directory.
The named file resides on a read-only file system.
The file is a pure procedure (shared text) file that is being executed.
An I/O error occurred updating the inode.
points outside the process's allocated address space.
is not a valid descriptor.
references a socket, not a file.
These calls should be generalized to allow ranges
of bytes in a file to be discarded.