Just tested it with MacOSX Mavericks and sbrk() behaves (nearly) the same than on Linux with two exceptions:
- I get a compiler warning:
tst21.c:12:6: warning: 'sbrk' is deprecated [-Wdeprecated-declarations]
- it doesn't seem to be possible to give back memory to the OS using a negative value (this is - as far as I remember - the same behaviour observed on SYSV4 decades ago: releasing memory allocated by
sbrk()
wasn't possible)