[comp.sys.next] Documentation conflict on sbrk

bates@wingra.stat.wisc.edu (Douglas Bates) (10/14/89)

I have been working on a port of an application from BSD Unix systems.
This uses sbrk(0) to determine the size of the dynamically allocated
memory.  When I went to check consistency in the calling sequence, I
found

 NAME
      brk, sbrk - change data segment size

      The UNIX system calls brk and sbrk are not supported on the
      NeXT computer.


but if you check for references to sbrk using the Digital Librarian,
you will find it mentioned in the manual page for end(3) as follows

     When execution begins, the program break coincides with _end
     but it is reset by the routines brk(2), malloc(3), standard
     input/output (stdio(3S)), the profile (-p) option of cc(1),
     etc.  The current value of the program break is reliably
     returned by `sbrk(0)', see brk(2).

It turns out that sbrk(0) does return an int giving the desired value.

Does the manual page for brk, sbrk just mean that you cannot change
the value with the calls but you can still query the value?

Douglas Bates
bates@stat.wisc.edu