#include <stress.h> |
int AllocFileHandles(Left) | |||||
int Left; | /* number of file handles to leave available | */ |
The AllocFileHandles function allocates file handles until only the specified number of file handles is available to the current instance of the application. If this or a smaller number of handles is available when an application calls AllocFileHandles, the function returns immediately.
Before allocating new handles, this function frees any handles previously allocates by AllocFileHandles.
Left
Specifies the number of file handles to leave available.
The return value is greater than zero if AllocFileHandles successfully allocates at least one file handle. The return value is zero if fewer than the specified number of file handles were available when the application called AllocFileHandles. The return value is –1 if the Left parameter is negative.
AllocFileHandles will not allocate more than 256 file handles, regardless of the number available to the application.
The UnAllocFileHandles function frees all file handles previously allocated by AllocFileHandles.