#ifndef _LINUX_TIME_H
#define _LINUX_TIME_H

#ifndef _STRUCT_TIMESPEC
#define _STRUCT_TIMESPEC
#ifndef __timespec_defined
#define __timespec_defined 1
struct timespec {
	long	tv_sec;		/* seconds */
	long	tv_nsec;	/* nanoseconds */
};
#endif /* __timespec_defined */
#endif /* _STRUCT_TIMESPEC */

#ifndef _STRUCT_TIMEVAL
#define _STRUCT_TIMEVAL
struct timeval {
	int	tv_sec;		/* seconds */
	int	tv_usec;	/* microseconds */
};
#endif

#ifdef __KERNEL__
struct timezone {
	int	tz_minuteswest;	/* minutes west of Greenwich */
	int	tz_dsttime;	/* type of dst correction */
};
#endif

#define NFDBITS			__NFDBITS

#ifdef __KERNEL__
void do_gettimeofday(struct timeval *tv);
void do_settimeofday(struct timeval *tv);
#endif

#define FD_SETSIZE		__FD_SETSIZE
#ifndef FD_SET
#define FD_SET(fd,fdsetp)	__FD_SET(fd,fdsetp)
#define FD_CLR(fd,fdsetp)	__FD_CLR(fd,fdsetp)
#define FD_ISSET(fd,fdsetp)	__FD_ISSET(fd,fdsetp)
#define FD_ZERO(fdsetp)		__FD_ZERO(fdsetp)
#endif /* FD_SET */

/*
 * Names of the interval timers, and structure
 * defining a timer setting.
 */
#ifdef __KERNEL__
#define	ITIMER_REAL	0
#define	ITIMER_VIRTUAL	1
#define	ITIMER_PROF	2
#endif

struct  itimerspec {
        struct  timespec it_interval;    /* timer period */
        struct  timespec it_value;       /* timer expiration */
};

#ifdef __KERNEL__
struct	itimerval {
	struct	timeval it_interval;	/* timer interval */
	struct	timeval it_value;	/* current value */
};
#endif

#endif
