Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (a - d) calloc32(3)
NAME
calloc32 - Allocates memory in an array
LIBRARY
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
SYNOPSIS
#include <sys/types.h>
#include <stdlib.h>
void _ptr32 *calloc32(
unsigned int element_count,
unsigned int element_size);
PARAMETERS
element_count Specifies the number of elements in the array.
element_size Specifies the size of each element in the array.
DESCRIPTION
The calloc32( ) function is used by 64-bit applications to allocate space from the secondary 32-
bit addressable heap resource.
The calloc32( ) function allocates space for an array with the number of elements specified by the
element_count parameter, where each element is of the size specified by the element_size param-
eter. The space is initialized to zeros. If the element_size parameter is 0 (zero), the function
returns a null pointer.
RETURN VALUES
This allocation function returns a pointer to space suitably aligned for storage of any type of
object. Cast the pointer to the type pointer-to-element before using it.
The calloc32( ) function returns a null pointer if there is no available memory or if the memory
area has been corrupted by storing outside the bounds of a block. When this happens, the block
pointed to by the pointer parameter could be destroyed.
ERRORS
If any of the following conditions occurs, the calloc32( ) function sets errno to the corresponding
value:
[ENOMEM] There is not enough storage memory in the system.
RELATED INFORMATION
Functions: free32(3), malloc32(3), realloc32(3).
STANDARDS CONFORMANCE
The POSIX standards leave some features to the implementing vendor to define. In the HP imple-
mentation, the calloc32( ) function returns a null pointer if the element_size parameter is 0 (zero).
527187-017 Hewlett-Packard Company 1−71