Notes of AUPE, chp 1

1. File IO: buffered & unbuffered (From Section 1.5)



2. Process Control (From Section 1.6)


There are three primary functions for process control: fork, exec, and waitpid.

Control-D, or ^D, is the default end-of-file character.


All the threads within a process share the same address space, file descriptors, stacks, and process-related attributes.

As with processes, threads are identified by IDs. Thread IDs, however, are local to a process.

Functions to control threads parallel those used to control processes.

3. Time

If the calendar time is stored as a signed 32-bit integer, in what year will it overflow?

对于calendar time,如果是32位有符号整型的时间值,只能计算到2038年(共68年)的秒数,会在2039年中溢出(具体哪天?)。如果是32位无符号整型,能计算到2109年(共139年)的秒数,在2110年溢出(具体哪天?)。

If the process time is stored as a signed 32-bit integer, and if the system counts 100 ticks per second, after how many days will the value overflow?

对于process time,如果是32位有符号整型的时间值,那么有

signed        100         248 day(0.6 year)

signed        60           414 day(1 year)

signed        50           497 day(1 year)

unsigned   100         497 day(1 year)

unsigned   60           828 day(2 year)

unsigned   50           994 day(2 year)


About chill

This entry was posted in Notes of APUE2. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s