brk man page on Plan9

Man page or keyword search:  
man Server   549 pages
apropos Keyword Search (all sections)
Output format
Plan9 logo
[printable version]

BRK(2)									BRK(2)

NAME
       brk, sbrk - change memory allocation

SYNOPSIS
       #include <u.h>
       #include <libc.h>

       int   brk(void *addr)

       void* sbrk(ulong incr)

DESCRIPTION
       Brk  sets  the system's idea of the lowest bss location not used by the
       program (called the break) to addr rounded up to the next multiple of 8
       bytes.	Locations  not	less than addr and below the stack pointer may
       cause a memory violation if accessed.

       In the alternate function sbrk, incr more bytes are added to  the  pro‐
       gram's  data  space  and	 a  pointer  to	 the  start of the new area is
       returned.  Rounding occurs as with brk.

       When a program begins execution via exec the break is set at the	 high‐
       est  location  defined by the program and data storage areas.  Ordinar‐
       ily, therefore, only programs with growing data areas need to use  brk.
       A  call	to sbrk with a zero argument returns the lowest address in the
       dynamic segment.

SOURCE
       /sys/src/libc/9sys/sbrk.c

SEE ALSO
       intro(2), malloc(2), segattach(2), segbrk(2)

DIAGNOSTICS
       These functions set errstr.

       The error return from sbrk is (void*)-1.

									BRK(2)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net