Skip to content



gettimeofday - get the current time


gettimeofday is a system call used to retrieve the current system time in seconds and microseconds. It allows an application to read the date and time stamp of the system and also to be notified of significant timers occurrences. The system time is used for managing resources such as network services or for evidence of user activities.

The call supports two argument parameters, tv and tz, either of which may be null. The tv parameter provides the seconds and microseconds since the epoch, and the tz parameter is used to provide an additional time-zone information, which is required by some standards or rules.

Edge cases of using this system call include potential race conditions in programs using this call, since the exact time of execution cannot be guaranteed when multiple processes are running.


  • tv:struct timeval*[U] - Pointer to a struct timeval, which will be filled with the time.
  • tz:struct timezone*[U] - Pointer to a struct timezone, which will be filled with the time zone information, or null if there is no need for this information.

Available Tags

  • K - Originated from the kernel-space.
  • U - Originated from user-space (for example, a pointer to user-space memory used to get it).






To trace the invocation of this function so that its timestamp, tz argument value and argument length information can be retrieved.

Example Use Case

An example use case for gettimeofday would be a social media platform using the system time to limit the frequency of notifications to users. By using gettimeofday, the platform can keep track of when a notification was sent in order to ensure that the user does not receive multiple notifications in a set amount of time.


When using gettimeofday, it is important to note that although this syscall provides accurate and reliable results, it still may suffer from clock jitter due to the multicore systems and timer interruptions, causing the resulting time value to be inconsistent.

  • settimeofday - sets the system date and time

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.