sbrk

Changes the amount of space allocated for the data segment of the calling process.

Library:LibC
Classification:Single UNIX
Service:File and Directory I/O

Syntax

  #include <unistd.h> 
   
  void *sbrk (
     intptr_t   incr );
  

Parameters

incr

(IN) Specifies the number of bytes to increase the break value. If the value is negative, the space decreases and break value is decrease by that number of bytes. If the value is 0, the current break value is returned.

Return Values

If successful, returns the prior break value. Otherwise, returns (void *) -1 and sets errno to one of the following.

Decimal

Constant

Description

5

ENOMEM

No memory is available.

24

EAGAIN

No memory is currently available.

105

ENOCONTEXT

The calling thread has no context.

See Also