VxWorks Reference Manual : Libraries

ftruncate

NAME

ftruncate - POSIX file truncation

ROUTINES

ftruncate( ) - truncate a file (POSIX)


Libraries : Routines

ftruncate( )

NAME

ftruncate( ) - truncate a file (POSIX)

SYNOPSIS

int ftruncate
    (
    int   fildes, /* fd of file to truncate */
    off_t length  /* length to truncate file */
    )

DESCRIPTION

This routine truncates a file to a specified size.

RETURNS

0 (OK) or -1 (ERROR) if unable to truncate file.

ERRNO

 EROFS 
  - File resides on a read-only file system.
 EBADF
  - File is open for reading only.
 EINVAL
  - File descriptor refers to a file on which this operation is impossible.

SEE ALSO

ftruncate