The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

sys/time.h - time types

 SYNOPSIS



#include <sys/time.h>

 DESCRIPTION

The <sys/time.h> header defines the timeval structure that includes at least the following members:

time_t         tv_sec      seconds
suseconds_t    tv_usec     microseconds

The <sys/time.h> header defines the itimerval structure that includes at least the following members:


struct timeval it_interval timer interval
struct timeval it_value    current value

The time_t and suseconds_t types are defined as described in <sys/types.h>.

The <sys/time.h> header defines the fd_set type as a structure that includes at least the following member:


long  fds_bits[]  bit mask for open file descriptions

The <sys/time.h> header defines the following values for the which argument of getitimer() and setitimer():

ITIMER_REAL
Decrements in real time.
ITIMER_VIRTUAL
Decrements in process virtual time.
ITIMER_PROF
Decrements both in process virtual time and when the system is running on behalf of the process.

Each of the following may be declared as a function, or defined as a macro, or both:

void FD_CLR(int fd, fd_set *fdset)
Clears the bit for the file descriptor fd in the file descriptor set fdset.
int FD_ISSET(int fd, fd_set *fdset)
Returns a non-zero value if the bit for the file descriptor fd is set in the file descriptor set by fdset, and 0 otherwise.
void FD_SET(int fd, fd_set *fdset)
Sets the bit for the file descriptor fd in the file descriptor set fdset.
void FD_ZERO(fd_set *fdset)
Initialises the file descriptor set fdset to have zero bits for all file descriptors.
FD_SETSIZE
Maximum number of file descriptors in an fd_set structure.

If implemented as macros, these may evaluate their arguments more than once, so that arguments must never be expressions with side effects.

The following are declared as functions and may also be defined as macros. Function prototypes must be provided for use with an ISO C compiler.


int   getitimer(int, struct itimerval *);
int   setitimer(int, const struct itimerval *, struct itimerval *);
int   gettimeofday(struct timeval *, void *);
int   select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
int   utimes(const char *, const struct timeval [2]);

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

getitimer(), gettimeofday(), select(), setitimer(), utimes().

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]