Skip to content



truncate64() - truncate a file to a specified length


The truncate64() system call is used to truncate a file to a specified length. If the file is larger than the length specified, the extra data is lost. If the file is shorter than the length specified, the file will be extended with NUL bytes (\0). The truncate64() system call operates on files, not directories.


  • path:const char* - pathname of the file whose length is to be changed
  • length:off_t - size to which the file should be truncated

Available Tags







To detect when the truncate64 system call is called

Example Use Case

truncate64() can be used to ensure that a certain file does not exceed a certain size. For example, it can be used to ensure a log file does not exceed 1GB in size.


The truncate64() system call does not check if the current user has the necessary permissions to truncate the file, this must be done manually.

  • open() - to open a file handle before truncating it
  • ftruncate64() - similar system call, but which operates on an open file descriptor

This document was automatically generated by OpenAI and needs review. It might not be accurate and might contain errors. The authors of Tracee recommend that the user reads the "events.go" source file to understand the events and their arguments better.