TIMEOUT(9)                   OpenBSD Kernel Manual                  TIMEOUT(9)

NAME
     timeout, untimeout - execute a function after a specified length of time

SYNOPSIS
     #include <sys/types.h>
     #include <sys/systm.h>

     void
     timeout(void (*ftn)(void *), void *arg, int ticks);

     void
     untimeout(void (*ftn)(void *), void *arg);

DESCRIPTION
     The function timeout() schedules a call to the function given by the ar-
     gument ftn to take place after ticks/hz seconds.  Non-positive values of
     ticks are silently converted to the value `1'. ftn should be a pointer to
     a function that takes a void * argument, to which the argument arg will
     be passed.

     The function untimeout() cancels the first scheduled call (i.e. the one
     with the shortest delay left) that matches the <ftn,arg> pair.  If a
     match can not be found in the callout queue, nothing happens.

     The callout queue is statically sized, dependent on the MAXUSERS parame-
     ter.

CODE REFERENCES
     These functions are implemented in the file sys/kern/kern_clock.c.

SEE ALSO
     hz(9),  sleep(9)

BUGS
     untimeout() should probably remove all matches from the queue.

OpenBSD 2.6                      June 23, 1996                               1
