
© 2007, QNX Software Systems GmbH & Co. KG. usbd
_
alloc()
Allocate a memory area to use for data transfers
Synopsis:
#include <sys/usbdi.h>
void *usbd_alloc( size_t size );
Arguments:
size The size, in bytes, of the area to allocate.
Library:
libusbdi
Description:
The usbd
_
alloc() function allocates a memory area that can then be used for data
transfers. You should use the memory area allocated by this function, because it’s
allocated efficiently and because its physical address is quickly obtained via
usbd
_
mphys().
The usbd
_
setup
_
*() functions require usbd
_
alloc()’d data buffers.
To free the memory, use usbd
_
free().
Returns:
A pointer to the start of the allocated memory, or NULL if there’s not enough memory.
Errors:
ENOMEM Insufficient memory available.
Classification:
QNX Neutrino, QNX 4
Safety
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes
September 10, 2007 Chapter 4 • USB Library Reference 19
Kommentare zu diesen Handbüchern