Home | History | Annotate | Download | only in linux
      1 #ifndef _LINUX_TIME_H
      2 #define _LINUX_TIME_H
      3 
      4 #include <linux/types.h>
      5 
      6 
      7 #ifndef _STRUCT_TIMESPEC
      8 #define _STRUCT_TIMESPEC
      9 struct timespec {
     10 	__kernel_time_t	tv_sec;			/* seconds */
     11 	long		tv_nsec;		/* nanoseconds */
     12 };
     13 #endif
     14 
     15 struct timeval {
     16 	__kernel_time_t		tv_sec;		/* seconds */
     17 	__kernel_suseconds_t	tv_usec;	/* microseconds */
     18 };
     19 
     20 struct timezone {
     21 	int	tz_minuteswest;	/* minutes west of Greenwich */
     22 	int	tz_dsttime;	/* type of dst correction */
     23 };
     24 
     25 
     26 #define NFDBITS			__NFDBITS
     27 
     28 #define FD_SETSIZE		__FD_SETSIZE
     29 #define FD_SET(fd,fdsetp)	__FD_SET(fd,fdsetp)
     30 #define FD_CLR(fd,fdsetp)	__FD_CLR(fd,fdsetp)
     31 #define FD_ISSET(fd,fdsetp)	__FD_ISSET(fd,fdsetp)
     32 #define FD_ZERO(fdsetp)		__FD_ZERO(fdsetp)
     33 
     34 /*
     35  * Names of the interval timers, and structure
     36  * defining a timer setting:
     37  */
     38 #define	ITIMER_REAL		0
     39 #define	ITIMER_VIRTUAL		1
     40 #define	ITIMER_PROF		2
     41 
     42 struct itimerspec {
     43 	struct timespec it_interval;	/* timer period */
     44 	struct timespec it_value;	/* timer expiration */
     45 };
     46 
     47 struct itimerval {
     48 	struct timeval it_interval;	/* timer interval */
     49 	struct timeval it_value;	/* current value */
     50 };
     51 
     52 /*
     53  * The IDs of the various system clocks (for POSIX.1b interval timers):
     54  */
     55 #define CLOCK_REALTIME			0
     56 #define CLOCK_MONOTONIC			1
     57 #define CLOCK_PROCESS_CPUTIME_ID	2
     58 #define CLOCK_THREAD_CPUTIME_ID		3
     59 #define CLOCK_MONOTONIC_RAW		4
     60 #define CLOCK_REALTIME_COARSE		5
     61 #define CLOCK_MONOTONIC_COARSE		6
     62 #define CLOCK_BOOTTIME			7
     63 #define CLOCK_REALTIME_ALARM		8
     64 #define CLOCK_BOOTTIME_ALARM		9
     65 
     66 /*
     67  * The IDs of various hardware clocks:
     68  */
     69 #define CLOCK_SGI_CYCLE			10
     70 #define MAX_CLOCKS			16
     71 #define CLOCKS_MASK			(CLOCK_REALTIME | CLOCK_MONOTONIC)
     72 #define CLOCKS_MONO			CLOCK_MONOTONIC
     73 
     74 /*
     75  * The various flags for setting POSIX.1b interval timers:
     76  */
     77 #define TIMER_ABSTIME			0x01
     78 
     79 #endif
     80