The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

valloc - page-aligned memory allocator (LEGACY)

 SYNOPSIS



#include <stdlib.h>

void *valloc(size_t size);

 DESCRIPTION

The valloc() function has the same effect as malloc(), 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.

 RETURN VALUE

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 valloc() returns a null pointer, errno is not modified.

 ERRORS

The valloc() function will fail if:
[ENOMEM]
Storage space available is insufficient.

 EXAMPLES

None.

 APPLICATION USAGE

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

 FUTURE DIRECTIONS

None.

 SEE ALSO

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

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]