HPlogo MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 4  POSIX/iX Library Function Descriptions

alarm

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Schedules a SIGALRM signal.

Syntax

   #include <unistd.h>

   unsigned int alarm (unsigned int seconds);

Parameters

seconds

The number of real-time seconds to wait before generating a SIGALRM signal. A zero cancels any previously scheduled alarm request.

Return Values

0

Success. There is no previously scheduled alarm.

>0

Success. The number of seconds remaining on a previously scheduled alarm is returned.

Description

The alarm() function causes the operating system to generate a SIGALRM signal for the calling process after the number of real-time seconds specified by the seconds parameter have elapsed. Operating system scheduling delays may prevent delivery of the signal until after the specified time.

Only one SIGALRM signal can be scheduled at a time. Any previously scheduled alarm is cancelled by the current alarm. A previously scheduled alarm is cancelled by passing zero in the seconds parameter.

Implementation Considerations

Currently, alarm() does not cause a read timeout.

Errors

None.

See Also

fork(), pause(), sigaction(), <signal.h>, POSIX.1 (Section 3.4.1)

Feedback to webmaster