Changeset 2b3dd78 in mainline for uspace/lib/posix/include/posix/time.h
- Timestamp:
- 2018-01-31T12:02:00Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5595841
- Parents:
- a0a9cc2 (diff), 14d789c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/include/posix/time.h
ra0a9cc2 r2b3dd78 37 37 #define POSIX_TIME_H_ 38 38 39 #ifndef __POSIX_DEF__40 #define __POSIX_DEF__(x) x41 #endif42 43 39 #include "sys/types.h" 44 40 … … 51 47 #ifndef __locale_t_defined 52 48 #define __locale_t_defined 53 typedef struct __posix_locale *__POSIX_DEF__(locale_t); 54 #ifndef LIBPOSIX_INTERNAL 55 #define locale_t __POSIX_DEF__(locale_t) 56 #endif 49 typedef struct __posix_locale *locale_t; 57 50 #endif 58 51 59 52 #ifndef POSIX_SIGNAL_H_ 60 struct __POSIX_DEF__(sigevent); 61 #ifndef LIBPOSIX_INTERNAL 62 #define sigevent __POSIX_DEF__(sigevent) 63 #endif 53 struct sigevent; 64 54 #endif 65 55 66 56 #undef CLOCK_REALTIME 67 #define CLOCK_REALTIME (( __POSIX_DEF__(clockid_t)) 0)57 #define CLOCK_REALTIME ((clockid_t) 0) 68 58 69 struct __POSIX_DEF__(timespec){59 struct timespec { 70 60 time_t tv_sec; /* Seconds. */ 71 61 long tv_nsec; /* Nanoseconds. */ 72 62 }; 73 63 74 struct __POSIX_DEF__(itimerspec){75 struct __POSIX_DEF__(timespec)it_interval; /* Timer period. */76 struct __POSIX_DEF__(timespec)it_value; /* Timer expiration. */64 struct itimerspec { 65 struct timespec it_interval; /* Timer period. */ 66 struct timespec it_value; /* Timer expiration. */ 77 67 }; 78 68 79 typedef struct __posix_timer * __POSIX_DEF__(timer_t);69 typedef struct __posix_timer *timer_t; 80 70 81 71 /* Timezones */ 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);72 extern int daylight; 73 extern long timezone; 74 extern char *tzname[2]; 75 extern void tzset(void); 86 76 87 77 /* Time */ 88 extern time_t __POSIX_DEF__(time)(time_t *t);78 extern time_t time(time_t *t); 89 79 90 80 /* Broken-down Time */ 91 extern struct tm * __POSIX_DEF__(gmtime_r)(const time_t *__restrict__ timer,81 extern struct tm *gmtime_r(const time_t *__restrict__ timer, 92 82 struct tm *__restrict__ result); 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,83 extern struct tm *gmtime(const time_t *__restrict__ timep); 84 extern struct tm *localtime_r(const time_t *__restrict__ timer, 95 85 struct tm *__restrict__ result); 96 extern struct tm * __POSIX_DEF__(localtime)(const time_t *__restrict__ timep);86 extern struct tm *localtime(const time_t *__restrict__ timep); 97 87 98 88 /* Formatting Calendar Time */ 99 extern char * __POSIX_DEF__(asctime_r)(const struct tm *__restrict__ timeptr,89 extern char *asctime_r(const struct tm *__restrict__ timeptr, 100 90 char *__restrict__ buf); 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);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); 104 94 extern time_t time(time_t *t); 105 95 106 96 /* Clocks */ 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);97 extern int clock_getres(clockid_t clock_id, 98 struct timespec *res); 99 extern int clock_gettime(clockid_t clock_id, 100 struct timespec *tp); 101 extern int clock_settime(clockid_t clock_id, 102 const struct timespec *tp); 103 extern int clock_nanosleep(clockid_t clock_id, int flags, 104 const struct timespec *rqtp, struct timespec *rmtp); 115 105 116 106 /* CPU Time */ 117 extern __POSIX_DEF__(clock_t) __POSIX_DEF__(clock)(void);107 extern clock_t clock(void); 118 108 119 109
Note:
See TracChangeset
for help on using the changeset viewer.