set process alarm clock
unsigned alarm(unsigned sec);
instructs the alarm clock of the process to send the signal
to the process after the number of real time seconds specified by
sec have elapsed
Alarm requests are not stacked;
successive calls reset the alarm clock of the calling process.
is 0, any previously made alarm request is canceled.
A newly created process has no pending alarm; they are not inherited.
Any pending alarm
is preserved across calls to any of the exec family of routines.
alarm returns the amount of time
previously remaining in the alarm clock of the calling process.
Considerations for threads programming
In multithreaded applications,
the alarm signal is delivered to only the requesting thread, no other.
A thread cannot respond to a signal until it is scheduled for execution.
For multiplexed threads,
there may be a time lag between delivery of the signal and the time
it is scheduled to run.
For improved response, consider using ``bound'' threads.
Considerations for lightweight processes
Internally, alarms are maintained per LWP.
The Threads Library
arranges for the signal to be delivered to the requesting thread,
even if the thread has been picked up by another LWP
between the time of request and the time of response.
Only the pending alarm (if any) of the calling LWP is
preserved across the
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004