Changes in uspace/lib/posix/include/posix/time.h [7a08c70:0dd4779] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/include/posix/time.h
r7a08c70 r0dd4779 37 37 #define POSIX_TIME_H_ 38 38 39 #ifndef __POSIX_DEF__ 40 #define __POSIX_DEF__(x) x 41 #endif 42 39 43 #include "sys/types.h" 40 44 … … 47 51 #ifndef __locale_t_defined 48 52 #define __locale_t_defined 49 typedef struct __posix_locale *locale_t; 53 typedef struct __posix_locale *__POSIX_DEF__(locale_t); 54 #ifndef LIBPOSIX_INTERNAL 55 #define locale_t __POSIX_DEF__(locale_t) 56 #endif 50 57 #endif 51 58 52 59 #ifndef POSIX_SIGNAL_H_ 53 struct sigevent; 60 struct __POSIX_DEF__(sigevent); 61 #ifndef LIBPOSIX_INTERNAL 62 #define sigevent __POSIX_DEF__(sigevent) 63 #endif 54 64 #endif 55 65 56 66 #undef CLOCK_REALTIME 57 #define CLOCK_REALTIME (( clockid_t) 0)67 #define CLOCK_REALTIME ((__POSIX_DEF__(clockid_t)) 0) 58 68 59 struct timespec{69 struct __POSIX_DEF__(timespec) { 60 70 time_t tv_sec; /* Seconds. */ 61 71 long tv_nsec; /* Nanoseconds. */ 62 72 }; 63 73 64 struct itimerspec{65 struct timespecit_interval; /* Timer period. */66 struct timespecit_value; /* Timer expiration. */74 struct __POSIX_DEF__(itimerspec) { 75 struct __POSIX_DEF__(timespec) it_interval; /* Timer period. */ 76 struct __POSIX_DEF__(timespec) it_value; /* Timer expiration. */ 67 77 }; 68 78 69 typedef struct __posix_timer * timer_t;79 typedef struct __posix_timer *__POSIX_DEF__(timer_t); 70 80 71 81 /* Timezones */ 72 extern int daylight;73 extern long timezone;74 extern char * tzname[2];75 extern void tzset(void);82 extern int __POSIX_DEF__(daylight); 83 extern long __POSIX_DEF__(timezone); 84 extern char *__POSIX_DEF__(tzname)[2]; 85 extern void __POSIX_DEF__(tzset)(void); 76 86 77 87 /* Time */ 78 extern time_t time(time_t *t);88 extern time_t __POSIX_DEF__(time)(time_t *t); 79 89 80 90 /* Broken-down Time */ 81 extern struct tm * gmtime_r(const time_t *__restrict__ timer,91 extern struct tm *__POSIX_DEF__(gmtime_r)(const time_t *__restrict__ timer, 82 92 struct tm *__restrict__ result); 83 extern struct tm * gmtime(const time_t *__restrict__ timep);84 extern struct tm * localtime_r(const time_t *__restrict__ timer,93 extern struct tm *__POSIX_DEF__(gmtime)(const time_t *__restrict__ timep); 94 extern struct tm *__POSIX_DEF__(localtime_r)(const time_t *__restrict__ timer, 85 95 struct tm *__restrict__ result); 86 extern struct tm * localtime(const time_t *__restrict__ timep);96 extern struct tm *__POSIX_DEF__(localtime)(const time_t *__restrict__ timep); 87 97 88 98 /* Formatting Calendar Time */ 89 extern char * asctime_r(const struct tm *__restrict__ timeptr,99 extern char *__POSIX_DEF__(asctime_r)(const struct tm *__restrict__ timeptr, 90 100 char *__restrict__ buf); 91 extern char * asctime(const struct tm *__restrict__ timeptr);92 extern char * ctime_r(const time_t *timer, char *buf);93 extern char * ctime(const time_t *timer);101 extern char *__POSIX_DEF__(asctime)(const struct tm *__restrict__ timeptr); 102 extern char *__POSIX_DEF__(ctime_r)(const time_t *timer, char *buf); 103 extern char *__POSIX_DEF__(ctime)(const time_t *timer); 94 104 extern time_t time(time_t *t); 95 105 96 106 /* Clocks */ 97 extern int clock_getres(clockid_tclock_id,98 struct timespec*res);99 extern int clock_gettime(clockid_tclock_id,100 struct timespec*tp);101 extern int clock_settime(clockid_tclock_id,102 const struct timespec *tp);103 extern int clock_nanosleep(clockid_tclock_id, int flags,104 const struct timespec *rqtp, struct timespec*rmtp);107 extern int __POSIX_DEF__(clock_getres)(__POSIX_DEF__(clockid_t) clock_id, 108 struct __POSIX_DEF__(timespec) *res); 109 extern int __POSIX_DEF__(clock_gettime)(__POSIX_DEF__(clockid_t) clock_id, 110 struct __POSIX_DEF__(timespec) *tp); 111 extern int __POSIX_DEF__(clock_settime)(__POSIX_DEF__(clockid_t) clock_id, 112 const struct __POSIX_DEF__(timespec) *tp); 113 extern int __POSIX_DEF__(clock_nanosleep)(__POSIX_DEF__(clockid_t) clock_id, int flags, 114 const struct __POSIX_DEF__(timespec) *rqtp, struct __POSIX_DEF__(timespec) *rmtp); 105 115 106 116 /* CPU Time */ 107 extern clock_t clock(void);117 extern __POSIX_DEF__(clock_t) __POSIX_DEF__(clock)(void); 108 118 109 119
Note:
See TracChangeset
for help on using the changeset viewer.