alarm(2) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

alarm(2)

alarm(2)                         System Calls                         alarm(2)

NAME
       alarm - schedule an alarm signal

SYNOPSIS
       #include <unistd.h>

       unsigned int alarm(unsigned int seconds);

DESCRIPTION
       The alarm() function causes the system to generate a SIGALRM signal for
       the  process after the number of real-time seconds specified by seconds
       have elapsed (see signal.h(3HEAD)).  Processor  scheduling  delays  may
       prevent  the  process  from handling the signal as soon as it is gener‐
       ated.


       If seconds is 0, a pending alarm request, if any, is cancelled. If sec‐
       onds  is  greater  than  LONG_MAX/hz,  seconds  is  rounded   down   to
       LONG_MAX/hz. The value of hz is normally 100.


       Alarm  requests  are  not  stacked;  only one SIGALRM generation can be
       scheduled in this manner; if the SIGALRM signal has not yet been gener‐
       ated, the call will result  in  rescheduling  the  time  at  which  the
       SIGALRM signal will be generated.


       The  fork(2) function clears pending alarms in the child process. A new
       process image created by one of the exec(2) functions inherits the time
       left to an alarm signal in the old process's image.

RETURN VALUES
       If there is a previous alarm request with time remaining,  alarm()  re‐
       turns a non-zero value that is the number of seconds until the previous
       request  would  have generated a SIGALRM signal. Otherwise, alarm() re‐
       turns 0.

ERRORS
       The alarm() function is always successful; no return value is  reserved
       to indicate an error.

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Interface  StabilityCommitted  _  MT-LevelAsync-Signal-
       Safe _ StandardSee standards(7).


SEE ALSO
       exec(2),  fork(2), setitimer(2), timer_create(3C), signal.h(3HEAD), at‐
       tributes(7), standards(7)

NOTES
       The alarm() function is independent of the setitimer(2)  and  sleep(3C)
       functions  on  Oracle  Solaris, but this cannot be relied upon for some
       other operating systems.

HISTORY
       The alarm() function has been included in all Sun and  Oracle  releases
       of Solaris.

Oracle Solaris 11.4               30 Jan 2023                         alarm(2)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3