Changeset fdf97f6 in mainline for uspace/lib/posix/include/posix/time.h
- Timestamp:
- 2013-02-25T19:11:50Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1935591
- Parents:
- c84f1a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/include/posix/time.h
rc84f1a4 rfdf97f6 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 … … 49 53 #ifndef __locale_t_defined 50 54 #define __locale_t_defined 51 typedef struct __posix_locale * posix_locale_t;55 typedef struct __posix_locale *__POSIX_DEF__(locale_t); 52 56 #ifndef LIBPOSIX_INTERNAL 53 #define locale_t posix_locale_t57 #define locale_t __POSIX_DEF__(locale_t) 54 58 #endif 55 59 #endif 56 60 57 61 #ifndef POSIX_SIGNAL_H_ 58 struct posix_sigevent;62 struct __POSIX_DEF__(sigevent); 59 63 #ifndef LIBPOSIX_INTERNAL 60 #define sigevent posix_sigevent64 #define sigevent __POSIX_DEF__(sigevent) 61 65 #endif 62 66 #endif 63 67 64 68 #undef CLOCK_REALTIME 65 #define CLOCK_REALTIME (( posix_clockid_t) 0)69 #define CLOCK_REALTIME ((__POSIX_DEF__(clockid_t)) 0) 66 70 67 struct posix_timespec{71 struct __POSIX_DEF__(timespec) { 68 72 time_t tv_sec; /* Seconds. */ 69 73 long tv_nsec; /* Nanoseconds. */ 70 74 }; 71 75 72 struct posix_itimerspec{73 struct posix_timespecit_interval; /* Timer period. */74 struct posix_timespecit_value; /* Timer expiration. */76 struct __POSIX_DEF__(itimerspec) { 77 struct __POSIX_DEF__(timespec) it_interval; /* Timer period. */ 78 struct __POSIX_DEF__(timespec) it_value; /* Timer expiration. */ 75 79 }; 76 80 77 typedef struct __posix_timer * posix_timer_t;81 typedef struct __posix_timer *__POSIX_DEF__(timer_t); 78 82 79 83 /* Timezones */ 80 extern int posix_daylight;81 extern long posix_timezone;82 extern char * posix_tzname[2];83 extern void posix_tzset(void);84 extern int __POSIX_DEF__(daylight); 85 extern long __POSIX_DEF__(timezone); 86 extern char *__POSIX_DEF__(tzname)[2]; 87 extern void __POSIX_DEF__(tzset)(void); 84 88 85 89 /* Broken-down Time */ 86 extern struct tm * posix_gmtime_r(const time_t *restrict timer,90 extern struct tm *__POSIX_DEF__(gmtime_r)(const time_t *restrict timer, 87 91 struct tm *restrict result); 88 extern struct tm * posix_gmtime(const time_t *restrict timep);89 extern struct tm * posix_localtime_r(const time_t *restrict timer,92 extern struct tm *__POSIX_DEF__(gmtime)(const time_t *restrict timep); 93 extern struct tm *__POSIX_DEF__(localtime_r)(const time_t *restrict timer, 90 94 struct tm *restrict result); 91 extern struct tm * posix_localtime(const time_t *restrict timep);95 extern struct tm *__POSIX_DEF__(localtime)(const time_t *restrict timep); 92 96 93 97 /* Formatting Calendar Time */ 94 extern char * posix_asctime_r(const struct tm *restrict timeptr,98 extern char *__POSIX_DEF__(asctime_r)(const struct tm *restrict timeptr, 95 99 char *restrict buf); 96 extern char * posix_asctime(const struct tm *restrict timeptr);97 extern char * posix_ctime_r(const time_t *timer, char *buf);98 extern char * posix_ctime(const time_t *timer);100 extern char *__POSIX_DEF__(asctime)(const struct tm *restrict timeptr); 101 extern char *__POSIX_DEF__(ctime_r)(const time_t *timer, char *buf); 102 extern char *__POSIX_DEF__(ctime)(const time_t *timer); 99 103 100 104 /* Clocks */ 101 extern int posix_clock_getres(posix_clockid_tclock_id,102 struct posix_timespec*res);103 extern int posix_clock_gettime(posix_clockid_tclock_id,104 struct posix_timespec*tp);105 extern int posix_clock_settime(posix_clockid_tclock_id,106 const struct posix_timespec*tp);107 extern int posix_clock_nanosleep(posix_clockid_tclock_id, int flags,108 const struct posix_timespec *rqtp, struct posix_timespec*rmtp);105 extern int __POSIX_DEF__(clock_getres)(__POSIX_DEF__(clockid_t) clock_id, 106 struct __POSIX_DEF__(timespec) *res); 107 extern int __POSIX_DEF__(clock_gettime)(__POSIX_DEF__(clockid_t) clock_id, 108 struct __POSIX_DEF__(timespec) *tp); 109 extern int __POSIX_DEF__(clock_settime)(__POSIX_DEF__(clockid_t) clock_id, 110 const struct __POSIX_DEF__(timespec) *tp); 111 extern int __POSIX_DEF__(clock_nanosleep)(__POSIX_DEF__(clockid_t) clock_id, int flags, 112 const struct __POSIX_DEF__(timespec) *rqtp, struct __POSIX_DEF__(timespec) *rmtp); 109 113 110 114 /* CPU Time */ 111 extern posix_clock_t posix_clock(void);115 extern __POSIX_DEF__(clock_t) __POSIX_DEF__(clock)(void); 112 116 113 #ifndef LIBPOSIX_INTERNAL114 #define timespec posix_timespec115 #define itimerspec posix_itimerspec116 #define timer_t posix_timer_t117 118 #define daylight posix_daylight119 #define timezone posix_timezone120 #define tzname posix_tzname121 #define tzset posix_tzset122 123 #define gmtime_r posix_gmtime_r124 #define gmtime posix_gmtime125 #define localtime_r posix_localtime_r126 #define localtime posix_localtime127 128 #define asctime_r posix_asctime_r129 #define asctime posix_asctime130 #define ctime_r posix_ctime_r131 #define ctime posix_ctime132 133 #define clock_getres posix_clock_getres134 #define clock_gettime posix_clock_gettime135 #define clock_settime posix_clock_settime136 #define clock_nanosleep posix_clock_nanosleep137 138 #define clock posix_clock139 #endif140 117 141 118 #endif // POSIX_TIME_H_
Note:
See TracChangeset
for help on using the changeset viewer.