@@ -42,22 +42,22 @@ __BEGIN_DECLS
42
42
/* If we just use void* in the typedef, the compiler exposes that in error messages. */
43
43
struct __timezone_t ;
44
44
45
- /** The `timezone_t` type that represents a time zone . */
45
+ /** The `timezone_t` type that represents a timezone . */
46
46
typedef struct __timezone_t * timezone_t ;
47
47
48
48
/** Divisor to compute seconds from the result of a call to clock(). */
49
49
#define CLOCKS_PER_SEC 1000000
50
50
51
51
/**
52
- * The name of the current time zone 's non-daylight savings (`tzname[0]`) and
52
+ * The name of the current timezone 's non-daylight savings (`tzname[0]`) and
53
53
* daylight savings (`tzname[1]`) variants. See tzset().
54
54
*/
55
55
extern char * _Nonnull tzname [];
56
56
57
- /** Whether the current time zone ever uses daylight savings time. See tzset(). */
57
+ /** Whether the current timezone ever uses daylight savings time. See tzset(). */
58
58
extern int daylight ;
59
59
60
- /** The difference in seconds between UTC and the current time zone . See tzset(). */
60
+ /** The difference in seconds between UTC and the current timezone . See tzset(). */
61
61
extern long int timezone ;
62
62
63
63
struct sigevent ;
@@ -86,7 +86,7 @@ struct tm {
86
86
int tm_isdst ;
87
87
/** Offset from UTC (GMT) in seconds for this time. */
88
88
long int tm_gmtoff ;
89
- /** Name of the time zone for this time. */
89
+ /** Name of the timezone for this time. */
90
90
const char * _Nullable tm_zone ;
91
91
};
92
92
@@ -145,7 +145,7 @@ double difftime(time_t __lhs, time_t __rhs);
145
145
* [mktime(3)](http://man7.org/linux/man-pages/man3/mktime.3p.html) converts
146
146
* broken-down time `tm` into the number of seconds since the Unix epoch.
147
147
*
148
- * See tzset() for details of how the time zone is set, and mktime_rz()
148
+ * See tzset() for details of how the timezone is set, and mktime_rz()
149
149
* for an alternative.
150
150
*
151
151
* Returns the time in seconds on success, and returns -1 and sets `errno` on failure.
@@ -154,7 +154,7 @@ time_t mktime(struct tm* _Nonnull __tm);
154
154
155
155
/**
156
156
* mktime_z(3) converts broken-down time `tm` into the number of seconds
157
- * since the Unix epoch, assuming the given time zone .
157
+ * since the Unix epoch, assuming the given timezone .
158
158
*
159
159
* Returns the time in seconds on success, and returns -1 and sets `errno` on failure.
160
160
*
@@ -178,7 +178,7 @@ struct tm* _Nullable localtime(const time_t* _Nonnull __t);
178
178
* the number of seconds since the Unix epoch in `t` to a broken-down time.
179
179
* That broken-down time will be written to the given struct `tm`.
180
180
*
181
- * See tzset() for details of how the time zone is set, and localtime_rz()
181
+ * See tzset() for details of how the timezone is set, and localtime_rz()
182
182
* for an alternative.
183
183
*
184
184
* Returns a pointer to a broken-down time on success, and returns null and sets `errno` on failure.
@@ -187,7 +187,7 @@ struct tm* _Nullable localtime_r(const time_t* _Nonnull __t, struct tm* _Nonnull
187
187
188
188
/**
189
189
* localtime_rz(3) converts the number of seconds since the Unix epoch in
190
- * `t` to a broken-down time, assuming the given time zone . That broken-down
190
+ * `t` to a broken-down time, assuming the given timezone . That broken-down
191
191
* time will be written to the given struct `tm`.
192
192
*
193
193
* Returns a pointer to a broken-down time on success, and returns null and sets `errno` on failure.
@@ -278,29 +278,36 @@ char* _Nullable ctime_r(const time_t* _Nonnull __t, char* _Nonnull __buf);
278
278
279
279
/**
280
280
* [tzset(3)](http://man7.org/linux/man-pages/man3/tzset.3.html) tells
281
- * libc that the time zone has changed.
281
+ * libc that the timezone has changed.
282
282
*
283
- * Android looks at both the system property `persist.sys.timezone` and the
284
- * environment variable `TZ`. The former is the device's current time zone
285
- * as shown in Settings, while the latter is usually unset but can be used
286
- * to override the global setting. This is a bad idea outside of unit tests
287
- * or single-threaded programs because it's inherently thread-unsafe.
288
- * See tzalloc(), localtime_rz(), mktime_z(), and tzfree() for an
289
- * alternative.
283
+ * tzset() on Android looks at both the system property
284
+ * `persist.sys.timezone` and the environment variable `TZ`. The former is
285
+ * the device's current timezone as shown in Settings, while the latter is
286
+ * usually unset but can be used to override the global setting. This is a
287
+ * bad idea outside of unit tests or single-threaded programs because it's
288
+ * inherently thread-unsafe. See tzalloc(), localtime_rz(), mktime_z(),
289
+ * and tzfree() for an alternative.
290
290
*/
291
291
void tzset (void );
292
292
293
293
/**
294
- * tzalloc(3) allocates a time zone corresponding to the given Olson id .
294
+ * tzalloc(3) allocates a timezone corresponding to the given Olson ID .
295
295
*
296
- * Returns a time zone object on success, and returns NULL and sets `errno` on failure.
296
+ * A null `id` returns the system timezone (as seen in Settings) from
297
+ * the system property `persist.sys.timezone`, ignoring `$TZ`. Although
298
+ * tzset() honors `$TZ`, callers of tzalloc() can use `$TZ` themselves if
299
+ * that's the (thread-unsafe) behavior they want, but by ignoring `$TZ`
300
+ * tzalloc() is thread safe (though obviously the system timezone can
301
+ * change, especially if your mobile device is actually mobile!).
302
+ *
303
+ * Returns a timezone object on success, and returns NULL and sets `errno` on failure.
297
304
*
298
305
* Available since API level 35.
299
306
*/
300
307
timezone_t _Nullable tzalloc (const char * _Nullable __id ) __INTRODUCED_IN (35 );
301
308
302
309
/**
303
- * tzfree(3) frees a time zone object returned by tzalloc().
310
+ * tzfree(3) frees a timezone object returned by tzalloc().
304
311
*
305
312
* Available since API level 35.
306
313
*/
@@ -320,7 +327,7 @@ clock_t clock(void);
320
327
321
328
/**
322
329
* [clock_getcpuclockid(3)](http://man7.org/linux/man-pages/man3/clock_getcpuclockid.3.html)
323
- * gets the clock id of the cpu-time clock for the given `pid`.
330
+ * gets the clock ID of the cpu-time clock for the given `pid`.
324
331
*
325
332
* Returns 0 on success, and returns -1 and returns an error number on failure.
326
333
*/
0 commit comments