VALLOC(3) Library Functions Manual VALLOC(3)

vallocpage-aligned memory allocator (LEGACY)

#include <stdlib.h>

void *valloc(size_t size);

The valloc() function has the same effect as malloc(3) , except that the allocated memory will be aligned to a multiple of the value returned by sysconf (_SC_PAGESIZE).

This interface need not be reentrant.

Upon successful completion, valloc() returns a pointer to the allocated memory. Otherwise, valloc() returns a null pointer and sets errno to indicate the error.

If size is 0, the behaviour is implementation-dependent; the value returned will be either a null pointer or a unique pointer. When size is 0 and returns a null pointer, is not modified.

The valloc() function will fail if:

Storage space available is insufficient.

None.

Applications should avoid using valloc() but should use malloc(3) or mmap(3) instead. On systems with a large page size, the number of successful valloc() operations may be zero.

None.

malloc(3) , sysconf(3) , <stdlib.h> .

February 1997 posix.fail