1 /* $Id: time.h,v 1.3 2002/05/17 01:47:13 hyperion Exp $
6 * time types. Conforming to the Single UNIX(r) Specification Version 2,
7 * System Interface & Headers Issue 5
9 * This file is part of the ReactOS Operating System.
12 * Created by KJK::Hyperion <noog@libero.it>
14 * THIS SOFTWARE IS NOT COPYRIGHTED
16 * This source code is offered for use in the public domain. You may
17 * use, modify or distribute it freely.
19 * This code is distributed in the hope that it will be useful but
20 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
21 * DISCLAMED. This includes but is not limited to warranties of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
25 #ifndef __TIME_H_INCLUDED__
26 #define __TIME_H_INCLUDED__
30 #include <sys/types.h>
33 /* extern static int getdate_err; */ /* FIXME */
35 extern long int timezone
;
36 extern char *tzname
[];
39 /* pre-declaration of signal.h types to suppress warnings caused by circular
45 int tm_sec
; /* seconds [0,61] */
46 int tm_min
; /* minutes [0,59] */
47 int tm_hour
; /* hour [0,23] */
48 int tm_mday
; /* day of month [1,31] */
49 int tm_mon
; /* month of year [0,11] */
50 int tm_year
; /* years since 1900 */
51 int tm_wday
; /* day of week [0,6] (Sunday = 0) */
52 int tm_yday
; /* day of year [0,365] */
53 int tm_isdst
; /* daylight savings flag */
58 time_t tv_sec
; /* seconds */
59 long tv_nsec
; /* nanoseconds */
64 struct timespec it_interval
; /* timer period */
65 struct timespec it_value
; /* timer expiration */
69 /* FIXME: all the constants are wrong */
70 /* Number of clock ticks per second returned by the times() function (LEGACY). */
72 /* A number used to convert the value returned by the clock() function into
74 #define CLOCKS_PER_SEC (1)
75 /* The identifier of the systemwide realtime clock. */
76 #define CLOCK_REALTIME (0)
77 /* Flag indicating time is absolute with respect to the clock associated with a
79 #define TIMER_ABSTIME (1)
82 char *asctime(const struct tm
*);
83 char *asctime_r(const struct tm
*, char *);
85 int clock_getres(clockid_t
, struct timespec
*);
86 int clock_gettime(clockid_t
, struct timespec
*);
87 int clock_settime(clockid_t
, const struct timespec
*);
88 char *ctime(const time_t *);
89 char *ctime_r(const time_t *, char *);
90 double difftime(time_t, time_t);
91 struct tm
*getdate(const char *);
92 struct tm
*gmtime(const time_t *);
93 struct tm
*gmtime_r(const time_t *, struct tm
*);
94 struct tm
*localtime(const time_t *);
95 struct tm
*localtime_r(const time_t *, struct tm
*);
96 time_t mktime(struct tm
*);
97 int nanosleep(const struct timespec
*, struct timespec
*);
98 size_t strftime(char *, size_t, const char *, const struct tm
*);
99 char *strptime(const char *, const char *, struct tm
*);
100 time_t time(time_t *);
101 int timer_create(clockid_t
, struct sigevent
*, timer_t
*);
102 int timer_delete(timer_t
);
103 int timer_gettime(timer_t
, struct itimerspec
*);
104 int timer_getoverrun(timer_t
);
105 int timer_settime(timer_t
, int, const struct itimerspec
*,
106 struct itimerspec
*);
111 #endif /* __TIME_H_INCLUDED__ */ /* replace with the appropriate tag */