www.delorie.com/djgpp/doc/libc-2.02/libc_73.html   search  
Go to the first, previous, next, last section, table of contents.


brk

Syntax

#include <unistd.h>

int brk(void *ptr);

Description

This function changes the break for the program. This is the first address that, if referenced, will cause a fault to occur. The program asks for more memory by specifying larger values for ptr. Normally, this is done transparently through the malloc function.

Return Value

Zero if the break was changed, -1 if not. errno is set to the error.

Portability

not ANSI, not POSIX

Example

if (brk(old_brk+1000))
  printf("no memory\n");


Go to the first, previous, next, last section, table of contents.

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 1998   by DJ Delorie     Updated Dec 1998  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)