Computer

Signal Alarm을 1초보다 빠르게 사용하고 싶을 때.

kcy1019 2014. 8. 2. 20:54

Q) How to use SIGALRM under 1sec?

A) Use ualarm() instead of alarm().

ualarm(useconds_t useconds, useconds_t interval);

--> useconds(단위: microsecond)만큼 지난 뒤 SIGALRM 발생.
      interval이 0이 아니라면 interval(단위는 같음)마다 SIGALRM 발생.

Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/ualarm.html