CS350 COS
COS
Loading...
Searching...
No Matches
time.h File Reference
#include <sys/types.h>
Include dependency graph for time.h:

Go to the source code of this file.

Data Structures

struct  timeval
 
struct  timezone
 

Functions

int gettimeofday (struct timeval *tv, struct timezone *tz)
 
int settimeofday (const struct timeval *tv, const struct timezone *tz)
 

Data Structure Documentation

◆ timeval

struct timeval

Definition at line 7 of file time.h.

Collaboration diagram for timeval:
[legend]
Data Fields
time_t tv_sec
suseconds_t tv_usec

◆ timezone

struct timezone

Definition at line 13 of file time.h.

Collaboration diagram for timezone:
[legend]
Data Fields
int tz_dsttime
int tz_minuteswest

Function Documentation

◆ gettimeofday()

int gettimeofday ( struct timeval tv,
struct timezone tz 
)

Definition at line 32 of file time.c.

33{
34 uint64_t nsec = OSTime();
35
36 tv->tv_sec = nsec / 1000000000;
37 tv->tv_usec = (nsec % 1000000000) / 1000;
38
39 return 0;
40}
uint64_t OSTime()
Definition: syscall.c:11
suseconds_t tv_usec
Definition: time.h:10
time_t tv_sec
Definition: time.h:9
unsigned long uint64_t
Definition: types.h:13
Here is the call graph for this function:

◆ settimeofday()

int settimeofday ( const struct timeval tv,
const struct timezone tz 
)

Definition at line 43 of file time.c.

44{
45 // set errno
46 return -1;
47}