Allocates or deallocates callout table entries for use with the timeout kernel service.
libsys.a (Kernel extension runtime routines)
#include <sys/types.h>
#include <sys/errno.h>
int timeoutcf ( cocnt)
int cocnt;
Item | Description |
---|---|
cocnt | Specifies the callout count. This value indicates the number of callout elements by which to increase or decrease the current allocation. If this number is positive, the number of callout entries for use with the timeout service is increased. If this number is negative, the number of elements is decreased by the amount specified. |
The timeoutcf subroutine is not part of the kernel. It is a compatibility service provided in the libsys.a library. To use the timeoutcf subroutine, a kernel extension must have been bound with the libsys.a library. The timeoutcf subroutine, like the associated kernel libsys services untimeout and timeout, can be bound and used only in the pinned part of a kernel extension or the bottom half of a device driver because these services use interrupt disable for serialization.
The timeoutcf subroutine registers an increase or decrease in the number of callout table entries available for the timeout subroutine to use. Before a subroutine can use the timeout kernel service, the timeoutcf subroutine must increase the number of callout table entries available to the timeout kernel service. It increases this number by the maximum number of outstanding time outs that the routine can have pending at one time.
The timeoutcf subroutine should be used to decrease the amount of callout table entries by the amount it was increased under the following conditions:
Typically the timeoutcf subroutine is called in a device driver's open and close routine. It is called to allocate and deallocate sufficient elements for the maximum expected use of the timeout kernel service for that instance of the open device.
Attention: A kernel panic results under either of these two circumstances:
The timeoutcf subroutine can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates a successful allocation or deallocation of the requested callout table entries. |
-1 | Indicates an unsuccessful operation. |