System Interface Guide

Other Memory Control Functions


sysconf(3C) returns the system dependent size of a memory page. For portability, applications should not embed any constants specifying the size of a page. Note that it is not unusual for page sizes to vary even among implementations of the same instruction set.


mprotect(2) assigns the specified protection to all pages in the specified address range. The protection cannot exceed the permissions allowed on the underlying object.

brk(2) and sbrk(2)

brk(2) and sbrk(2) are called to add storage to the data segment of a process.

A process can manipulate this area by calling brk(2) and sbrk(2):

 brk(caddr_t addr);

 sbrk(intptr_t incr); 

brk(2) identifies the lowest data segment location not used by the caller as addr (rounded up to the next multiple of the system page size).

sbrk(2), the alternate function, adds incr bytes to the caller data space and returns a pointer to the start of the new data area.