Back to index

glibc  2.9
Functions | Variables
brk.c File Reference
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>

Go to the source code of this file.

Functions

 weak_alias (__curbrk, ___brk_addr)

Variables

void * __curbrk = 0

Function Documentation

weak_alias ( __curbrk  ,
___brk_addr   
)

Definition at line 30 of file brk.c.

{
  void *newbrk;

  {
    register void *__addr asm("2") = addr;

    asm ("svc  %b1\n\t"            /* call sys_brk */
        : "=d" (__addr)
        : "I" (SYS_ify(brk)), "r" (__addr)
        : "cc", "memory" );
    newbrk = __addr;
  }
  __curbrk = newbrk;

  if (newbrk < addr)
    {
      __set_errno (ENOMEM);
      return -1;
    }

  return 0;
}

Variable Documentation

void* __curbrk = 0

Definition at line 25 of file brk.c.