Rev | Author | # | Line |
---|---|---|---|
2 | PerryLorier | 1 | sbrk - change data segment size |
1 | perry | 2 | !!SYNOPSIS |
2 | PerryLorier | 3 | __#include <unistd.h>__ |
1 | perry | 4 | |
5 | |||
2 | PerryLorier | 6 | __void *sbrk(ptrdiff_t__ ''increment''__);__ |
1 | perry | 7 | !!DESCRIPTION |
2 | PerryLorier | 8 | brk(2) sets the end of the data segment to the value specified by ''end_data_segment'', when that value is reasonable, the system does have enough memory and the |
9 | process does not exceed its max data size (see setrlimit(2)). | ||
1 | perry | 10 | |
2 | PerryLorier | 11 | sbrk(2) increments the program's data space by ''increment'' bytes. sbrk(2) isn't a system call, it is just a C library wrapper. Calling sbrk(2) with an increment of 0 can be used to find the current location of the program break. |
1 | perry | 12 | |
13 | !!RETURN VALUE | ||
2 | PerryLorier | 14 | On success, sbrk(2) returns a pointer to the start of the new area. On error, -1 is returned, and ''errno'' is set to [ENOMEM]. |
1 | perry | 15 | !!CONFORMING TO |
16 | BSD 4.3 | ||
17 | |||
2 | PerryLorier | 18 | sbrk(2) is not defined in the C Standard and is deliberately excluded from the POSIX.1 standard (see paragraphs B.1.1.1.3 and B.8.3.3). |
1 | perry | 19 | |
20 | !!SEE ALSO | ||
2 | PerryLorier | 21 | execve(2), getrlimit(2), malloc(3), brk(2) |
lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 3 times)