Changeset 324d46b in mainline for uspace/lib/posix/time.h
- Timestamp:
- 2011-07-07T01:32:53Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3f466c33
- Parents:
- 08053f7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/time.h
r08053f7 r324d46b 38 38 39 39 #include "libc/time.h" 40 #include "sys/types.h" 40 41 41 42 #ifndef NULL … … 43 44 #endif 44 45 45 #undef CLOCKS_PER_SEC 46 #define CLOCKS_PER_SEC 1000000L 46 #ifndef CLOCKS_PER_SEC 47 #define CLOCKS_PER_SEC (1000000L) 48 #endif 49 50 #ifndef __locale_t_defined 51 #define __locale_t_defined 52 typedef struct __posix_locale *posix_locale_t; 53 #ifndef LIBPOSIX_INTERNAL 54 #define locale_t posix_locale_t 55 #endif 56 #endif 57 58 #undef ASCTIME_BUF_LEN 59 #define ASCTIME_BUF_LEN 26 60 61 #undef CLOCK_REALTIME 62 #define CLOCK_REALTIME ((posix_clockid_t) 0) 47 63 48 64 struct posix_tm { … … 58 74 }; 59 75 76 // FIXME: should be in sys/types.h 60 77 typedef long posix_clock_t; 61 78 79 struct posix_timespec { 80 time_t tv_sec; /* Seconds. */ 81 long tv_nsec; /* Nanoseconds. */ 82 }; 83 84 struct posix_itimerspec { 85 struct posix_timespec it_interval; /* Timer period. */ 86 struct posix_timespec it_value; /* Timer expiration. */ 87 }; 88 89 /* Timezones */ 90 91 extern int posix_daylight; 92 extern long posix_timezone; 93 extern char *posix_tzname[2]; 94 95 extern void posix_tzset(void); 96 97 /* time_t */ 98 99 extern double posix_difftime(time_t time1, time_t time0); 100 62 101 /* Broken-down Time */ 102 extern time_t posix_mktime(struct posix_tm *timeptr); 63 103 extern struct posix_tm *posix_localtime(const time_t *timep); 64 104 extern struct posix_tm *posix_localtime_r(const time_t *restrict timer, 105 struct posix_tm *restrict result); 65 106 /* Formatting Calendar Time */ 66 extern char *posix_asctime(const struct posix_tm *tm); 107 extern char *posix_asctime(const struct posix_tm *timeptr); 108 extern char *posix_asctime_r(const struct posix_tm *restrict timeptr, 109 char *restrict buf); 67 110 extern char *posix_ctime(const time_t *timep); 68 extern size_t posix_strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct posix_tm *restrict tm); 111 extern size_t posix_strftime(char *restrict s, size_t maxsize, 112 const char *restrict format, const struct posix_tm *restrict tm); 69 113 70 114 /* CPU Time */ 71 115 extern posix_clock_t posix_clock(void); 116 72 117 73 118 #ifndef LIBPOSIX_INTERNAL … … 75 120 76 121 #define clock_t posix_clock_t 122 #define timespec posix_timespec 123 #define itimerspec posix_itimerspec 77 124 125 #define difftime posix_difftime 126 #define mktime posix_mktime 78 127 #define localtime posix_localtime 128 #define localtime_r posix_localtime_r 129 130 #define daylight posix_daylight 131 #define timezone posix_timezone 132 #define tzname posix_tzname 133 #define tzset posix_tzset 79 134 80 135 #define asctime posix_asctime 136 #define asctime_r posix_asctime_r 81 137 #define ctime posix_ctime 82 138 #define strftime posix_strftime
Note:
See TracChangeset
for help on using the changeset viewer.