Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

valloc(3) Guardian Native C Library Calls Reference Manual
NAME
valloc - Provide a memory allocator
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL
G-series native OSS processes: /G/system/sysnn/zcresrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
SYNOPSIS
#include <sys/types.h>
#include <stdlib.h>
void *valloc(
size_t size);
PARAMETERS
size Specifies the number of bytes of memory to be allocated.
DESCRIPTION
The valloc() function returns a pointer to a block of memory of at least the number of bytes
specified by the size parameter. The block is aligned so that it can be used for any type of data.
If the size parameter is 0 (zero), the function returns a null pointer.
The valloc() function behaves like malloc(), except that the allocated memory is automatically
aligned to a page boundary (that is, aligned to the value returned by a call to getpagesize( )).
The valloc() function can be called by native processes only.
NOTES
Applications should avoid using valloc() and use the malloc() function instead.
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 valloc() functions 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 valloc() function sets errno to the corresponding
value:
[ENOMEM] There is not enough storage memory in the system.
RELATED INFORMATION
Functions: calloc(3), free(3), getpagesize(3), malloc(3), realloc(3).
STANDARDS CONFORMANCE
The valloc() function is specified by the XPG4 Version 2 specification.
758 Hewlett-Packard Company 527192-018