| 3146 | to sys_time invokes the underlying system's 'time' function. */ |
| 3147 | |
| 3148 | time_t |
| 3149 | time(time_t *p) |
| 3150 | { |
| 3151 | time_t r = sys_time(NULL); |
| 3152 | if (r != (time_t) -1) { |
| 3153 | iinntt offset = EPOCH_LOCAL ? timezone : 0; |
| 3154 | if (offset < IINNTT_MIN + EPOCH_OFFSET |
| 3155 | || increment_overflow_time_iinntt(&r, offset - EPOCH_OFFSET)) { |
| 3156 | errno = EOVERFLOW; |
| 3157 | r = -1; |
| 3158 | } |
| 3159 | } |
| 3160 | if (p) |
| 3161 | *p = r; |
| 3162 | return r; |
| 3163 | } |
| 3164 | |
| 3165 | # endif |
| 3166 | #endif |
no test coverage detected