The Linux Programming Interface

(nextflipdebug5) #1

210 Chapter 10


time and human-readable character strings. Describing such conversions took us into
a discussion of locales and internationalization.
Using and displaying times and dates is an important part of many applications,
and we’ll make frequent use of the functions described in this chapter in later parts
of this book. We also say a little more about the measurement of time in Chapter 23.

Further information
Details of how the Linux kernel measures time can be found in [Love, 2010].
An extensive discussion of timezones and internationalization can be found in
the GNU C library manual (online at http://www.gnu.org/). The SUSv3 documents
also cover locales in detail.

10.9 Exercise


10-1. Assume a system where the value returned by the call sysconf(_SC_CLK_TCK) is


  1. Assuming that the clock_t value returned by times() is an unsigned 32-bit
    integer, how long will it take before this value cycles so that it restarts at 0? Perform
    the same calculation for the CLOCKS_PER_SEC value returned by clock().

Free download pdf