Potential undocumented functionality of brk when called with NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Reading the man-pages entry for brk, I found that there's a specific bit of behavior that is explicitly documented for sbrk, however not for brk:

RETURN VALUE
       On success, brk() returns zero.  On error, -1 is returned, and errno is set to ENOMEM.

       On success, sbrk() returns the previous program break.  (If the break was increased, then this value is a pointer to the start of the newly allocated memory).  On error, (void *) -1 is returned, and errno is set to ENOMEM.

Here, it's stated that brk() returns zero on success and -1 on error. Some programs, though, use brk(NULL). This returns neither zero nor -1. Instead, it returns a pointer to the program break, suggesting that this functionality should be documented for brk as well.

I have made sure to read the man-pages repository as of its latest commit 65dfda3dd.

Thank you very much for your time,
Fausto



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux