SYNOPSIS
#include <unistd.h>
int chsize(int fildes, long size);
DESCRIPTION
The
PARAMETERS
- fildes
-
Is the file descriptor of a disk file opened with write access.
- size
-
Is the new file length, in bytes. If size is less than the initial size of the file, all allocated disk blocks between size and the initial file size are freed. If size is negative, then the file is truncated to zero length.
RETURN VALUES
If successful,
- EBADF
-
File descriptor is not open.
- EACCES
-
File is not opened for writing.
- EINVAL
-
File descriptor is not for a disk file.
- ENOSPC
-
Insufficient space on device.
CONFORMANCE
SVR4
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
If
This function is deprecated;
use
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
creat() ,ftruncate() ,lseek() ,open() ,truncate()
PTC MKS Toolkit 10.5 Documentation Build 40.