Writing Device Drivers

Handling Resource Allocation Failures

The resource-allocation routines provide the driver with several options when handling allocation failures. The waitfp argument indicates whether the allocation routines block, return immediately, or schedule a callback, as shown in the following table.

Table 9–1 Resource Allocation Handling

waitfp value

Indicated Action 


Driver does not want to wait for resources to become available 


Driver is willing to wait indefinitely for resources to become available 

Other values 

The address of a function to be called when resources are likely to be available