Back to index

glibc  2.9
ftruncate.c File Reference
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

Go to the source code of this file.


int ftruncate (int fd, off_t length)

Function Documentation

int ftruncate ( int  fd,
off_t  length 

Definition at line 27 of file ftruncate.c.

  struct flock fl;

  memset (&fl, 0, sizeof fl);
  fl.l_type = F_WRLCK;
  fl.l_start = length;
  return fcntl (fd, F_FREESP, &fl);

Here is the call graph for this function:

Here is the caller graph for this function: