00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef _TIME_H_
00047 #define _TIME_H_
00048
00049 #include <sys/cdefs.h>
00050 #include <sys/_null.h>
00051 #include <sys/_types.h>
00052 #ifdef __SYMBIAN32__
00053 #include <sys/types.h>
00054 #endif
00055
00056 #if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE
00057
00058
00059
00060
00061 #ifdef __SYMBIAN32__
00062 #define CLK_TCK 128
00063
00064 #endif
00065 #endif
00066
00067
00068 #ifndef __SYMBIAN32__
00069 #define CLOCKS_PER_SEC 128
00070
00071 #endif
00072
00073 #ifndef _CLOCK_T_DECLARED
00074 typedef __clock_t clock_t;
00075 #define _CLOCK_T_DECLARED
00076 #endif
00077
00078 #ifndef _TIME_T_DECLARED
00079 typedef __time_t time_t;
00080 #define _TIME_T_DECLARED
00081 #endif
00082
00083 #ifndef _SIZE_T_DECLARED
00084 typedef __size_t size_t;
00085 #define _SIZE_T_DECLARED
00086 #endif
00087
00088 #if __POSIX_VISIBLE >= 199309
00089
00090
00091
00092 #ifndef _CLOCKID_T_DECLARED
00093 typedef __clockid_t clockid_t;
00094 #define _CLOCKID_T_DECLARED
00095 #endif
00096
00097 #ifndef _TIMER_T_DECLARED
00098 typedef __timer_t timer_t;
00099 #define _TIMER_T_DECLARED
00100 #endif
00101
00102 #include <sys/timespec.h>
00103 #endif
00104
00105
00106 #if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112
00107 #define CLOCK_REALTIME 0
00108 #ifdef __BSD_VISIBLE
00109 #define CLOCK_VIRTUAL 1
00110 #define CLOCK_PROF 2
00111 #endif
00112 #define CLOCK_MONOTONIC 4
00113 #endif
00114
00115 #if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112
00116 #if __BSD_VISIBLE
00117 #define TIMER_RELTIME 0x0
00118 #endif
00119 #define TIMER_ABSTIME 0x1
00120 #endif
00121
00122 struct tm {
00123 int tm_sec;
00124 int tm_min;
00125 int tm_hour;
00126 int tm_mday;
00127 int tm_mon;
00128 int tm_year;
00129 int tm_wday;
00130 int tm_yday;
00131 int tm_isdst;
00132 long tm_gmtoff;
00133 char *tm_zone;
00134 };
00135
00136 #if __POSIX_VISIBLE
00137 extern char *tzname[];
00138 #endif
00139
00140 __BEGIN_DECLS
00141 IMPORT_C
00142 char *asctime(const struct tm *);
00143 IMPORT_C
00144 clock_t clock(void);
00145 IMPORT_C
00146 char *ctime(const time_t *);
00147 IMPORT_C
00148 double difftime(time_t, time_t);
00149
00150 IMPORT_C
00151 struct tm *gmtime(const time_t *);
00152 IMPORT_C
00153 struct tm *localtime(const time_t *);
00154 IMPORT_C
00155 time_t mktime(struct tm *);
00156 IMPORT_C
00157 size_t strftime(char * __restrict, size_t, const char * __restrict,
00158 const struct tm * __restrict);
00159 IMPORT_C
00160 time_t time(time_t *);
00161
00162 #if __POSIX_VISIBLE
00163 IMPORT_C
00164 void tzset(void);
00165 #endif
00166
00167 #if __POSIX_VISIBLE >= 199309
00168 IMPORT_C
00169 int clock_getres(clockid_t, struct timespec *);
00170 IMPORT_C
00171 int clock_gettime(clockid_t, struct timespec *);
00172 IMPORT_C
00173 int clock_settime(clockid_t, const struct timespec *);
00174
00175 IMPORT_C
00176 int nanosleep(const struct timespec *, struct timespec *);
00177 #endif
00178
00179 #ifdef __SYMBIAN32__
00180 IMPORT_C
00181 int clock_getcpuclockid(pid_t , clockid_t *);
00182
00183 #endif
00184
00185
00186 #if __POSIX_VISIBLE >= 199506
00187 IMPORT_C
00188 char *asctime_r(const struct tm *, char *);
00189 IMPORT_C
00190 char *ctime_r(const time_t *, char *);
00191 IMPORT_C
00192 struct tm *gmtime_r(const time_t *, struct tm *);
00193 IMPORT_C
00194 struct tm *localtime_r(const time_t *, struct tm *);
00195 #endif
00196
00197 #if __XSI_VISIBLE
00198 IMPORT_C
00199 char *strptime(const char * __restrict, const char * __restrict,
00200 struct tm * __restrict);
00201 #endif
00202
00203 #if __BSD_VISIBLE
00204 char *timezone(int, int);
00205 void tzsetwall(void);
00206 time_t timelocal(struct tm * const);
00207 IMPORT_C time_t timegm(struct tm * const);
00208 #endif
00209 __END_DECLS
00210
00211 #endif