Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ brk(2) — sys5 — Apollo Domain/IX SR9.5

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exec(2)

shmop(2)



BRK(2)                   DOMAIN/IX SYS5                    BRK(2)



NAME
     brk, sbrk - change amount of memory available

USAGE
     int brk (endds)
     char *endds;

     char *sbrk (incr)
     int incr;


DESCRIPTION
     These calls manipulate the break value of the calling pro-
     gram.  The break value is the address of the first location
     beyond the end of available memory; the amount of allocated
     space increases as the break value increases.  Newly allo-
     cated space is set to zero.

     Both brk and sbrk change the break value while the process
     is running.

     Brk sets the break value to endds.

     Sbrk adds incr bytes to the break value.  Incr can be nega-
     tive, in which case the amount of allocated space is nomi-
     nally decreased.

RETURN VALUE
     A successful call to brk returns zero.  A successful call to
     sbrk returns the old break value.  A failed call returns -1
     and sets errno as indicated below.

ERRORS
     Both brk and sbrk will fail without making any changes if
     one or more of the following is true:

     [ENOMEM]  The change would result in a break value greater
               than or equal to the start address of any attached
               shared memory segment (see shmop(2)), or would
               result in more space being allocated than is
               available on the system.

RELATED INFORMATION
     exec(2), shmop(2)









Printed 12/4/86                                             BRK-1





Typewritten Software • bear@typewritten.org • Edmonds, WA 98026