614 Chapter 28
Timers
Interval timers Yes No setitimer().
Timers set by alarm() Yes No alarm().
POSIX timers No No timer_create() and related calls.
POSIX threads
Threads No See
notes
During fork(), only calling thread is replicated in
child.
Thread cancelability state
and type
No Yes After an exec(), the cancelability type and state
are reset to PTHREAD_CANCEL_ENABLE and
PTHREAD_CANCEL_DEFERRED, respectively
Mutexes and
condition variables
No Yes See Section 33.3 for details of the treatment of
mutexes and other thread resources during
fork().
Priority and scheduling
Nice value Yes Yes nice(), setpriority().
Scheduling policy and priority Yes Yes sched_setscheduler(), sched_setparam().
Resources and CPU time
Resource limits Yes Yes setrlimit().
Process and child CPU times Yes No As returned by times().
Resource usages Yes No As returned by getrusage().
Interprocess communication
System V shared
memory segments
No Yes shmat(), shmdt().
POSIX shared memory No Yes shm_open() and related calls.
POSIX message queues No Yes mq_open() and related calls. Descriptors in child
and parent refer to same open message queue
descriptions. A child doesn’t inherit its parent’s
message notification registrations.
POSIX named semaphores No Shared sem_open() and related calls. Child shares
references to same semaphores as parent.
POSIX unnamed semaphores No See
notes
sem_init() and related calls. If semaphores are in
a shared memory region, then child shares
semaphores with parent; otherwise, child has its
own copy of the semaphores.
System V semaphore
adjustments
Yes No semop(). See Section 47.8.
File locks Yes See
notes
flock(). Child inherits a reference to the same
lock as parent.
Record locks See
notes
No fcntl(F_SETLK). Locks are preserved across exec()
unless a file descriptor referring to the file is
marked close-on-exec; see Section 55.3.5.
Table 28-4: Effect of exec() and fork() on process attributes (continued)
Process attribute exec() fork() Interfaces affecting attribute; additional notes