Lines Matching refs:alarm
188 .. function:: alarm(time)
191 sent to the process in *time* seconds. Any previously scheduled alarm is
192 canceled (only one alarm can be scheduled at any time). The returned value is
193 then the number of seconds before any previously set alarm was to have been
194 delivered. If *time* is zero, no alarm is scheduled, and any scheduled alarm is
195 canceled. If the return value is zero, no alarm is currently scheduled. (See
196 the Unix man page :manpage:`alarm(2)`.)
283 :func:`alarm`) and after that every *interval* seconds (if *interval*
473 Here is a minimal example program. It uses the :func:`alarm` function to limit
476 :func:`os.open` to hang indefinitely. The solution is to set a 5-second alarm
477 before opening the file; if the operation takes too long, the alarm signal will
486 # Set the signal handler and a 5-second alarm
488 signal.alarm(5)
493 signal.alarm(0) # Disable the alarm