AT&T UNIX™PC Unix System V Users Manual - tenox
AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox
I�
BRK(2) BRK ( 2 ) NAME brk, sbrk - change data segment space allocation SYNOPSIS int brk (endds) char *endds; char *sbrk (incr) int incr; DESCRIPTION Brk and sbrk are used to change dynamically the amount of space allocated for the calling process's data segment; see exec(2). The change is made by resetting the process's break value and allocating the appropriate amount of space. The break value is the address of the first location beyond the end of the data segment. The amount of allocated space increases as the break value increases. Brk sets the break value to endds and changes the allocated space accordingly. Sbrk adds incr bytes to the break value and changes the allocated space accordingly. !ncr can be negative, in which case the amount of allocated space is decreased. Sbrk clears only the page actually allocated, starting at a page boundary. Brk and sbrk will fail without making any change in the allocated space if one or more of the following are true: Such a change would result in more space being allocated than is allowed by a system-imposed maximum (see ulimit(2)). jENOMEMI Such a change would result in the break value being greater than or equal to the start address of any attached shared memory segment (see shmop(2)). RETURN VALUE Upon successful completion, brk returns a value of 0 and sbrk returns the old break value. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO exec(2). - 1 -
- Page 611 and 612: UUX ( lC ) UUX ( lC ) NAME uux - UN
- Page 613 and 614: VAL(l) VAL(I) NAME val - validate s
- Page 615 and 616: VC (l) VC (l) NAME vc - version con
- Page 617: VC (l) VC ( l ) ::text Used for key
- Page 620 and 621: VI ( 1) vi file vi vi + n file vi +
- Page 622 and 623: VI (l) rn OAD Av MODIFYING TEXT Cha
- Page 624 and 625: VI ( 1 ) VI( 1) file to newtext :gf
- Page 626 and 627: VI (l) VI (l) :set x? Show value of
- Page 628 and 629: VI (l) VI ( 1) mapped to I, then if
- Page 630 and 631: VI (l) VI (l) won't be broken. Inse
- Page 632 and 633: � I . .... .,_ J _ . . ·
- Page 634 and 635: .. \ '-�� -·
- Page 637 and 638: WIIO (I) WHO(l) NAME who - who is o
- Page 639: WRITE ( l ) WRITE ( l ) NAME write
- Page 642 and 643: XARGS(l) XARGS (l) -nnumber Execute
- Page 645 and 646: YACC { I ) YACC { l ) NAME yacc - y
- Page 647 and 648: INTRO ( 2) INTR0 ( 2 ) NAME intro -
- Page 649 and 650: INTRO ( 2) INTR0 (2) 21 EISDffi Is
- Page 651 and 652: INTRO (2) INTRO ( 2) ProcO is the s
- Page 653 and 654: INTR0 (2) INTR0 (2) permission requ
- Page 655 and 656: INTR0 (2) time_t shm_dtime; time_t
- Page 657: ACCESS (2} ACCESS (2} NAME access -
- Page 661: ALARM (2) ALARM (2) NAME alarm - se
- Page 667 and 668: CHMOD (2) CHMOD (2) NAME chmod - ch
- Page 669: CHOWN(2) CHOWN(2) NAME chown - chan
- Page 673 and 674: CLOSE ( 2) CLOSE (2) NAME close - c
- Page 675 and 676: CREAT ( 2 ) CREAT ( 2 ) NAME creat
- Page 677 and 678: DUP (2) DUP (2) NAME dup - duplicat
- Page 679 and 680: EXEC (2) EXEC (2) NAME execl, execv
- Page 681: EXEC (2) EXEC (2) Search perm1ss10n
- Page 684 and 685: EXIT (2) EXIT (2) WARNING See WARNI
- Page 686 and 687: FCNTL (2) FCNTL (2) immediately wit
- Page 689 and 690: FORK(2) FORK(2) NAME fork - create
- Page 691: GETPID ( 2} GETPID (2) NAME getpid,
- Page 694 and 695: I I I I I I I I I I I I I I I I I I
- Page 696 and 697: �-
- Page 699: LINK ( 2 ) LINK ( 2 ) NAME link - l
- Page 703 and 704: MKNOD (2) MKNOD (2) NAME mknod - ma
- Page 705: MOUNT (2) MOUNT (2) NAME mount - mo
- Page 708 and 709: MSGCTL(2) MSGCTL ( 2 ) user ID of t
- Page 710 and 711: MSGGET (2) MSGGET (2) SEE ALSO msgc
BRK(2) BRK ( 2 )<br />
NAME<br />
brk, sbrk - change data segment space allocation<br />
SYNOPSIS<br />
int brk (endds)<br />
char *endds;<br />
char *sbrk (incr)<br />
int incr;<br />
DESCRIPTION<br />
Brk and sbrk are used to change dynamically the amount of space<br />
allocated for the calling process's data segment; see exec(2). The<br />
change is made by resetting the process's break value and allocating<br />
the appropriate amount of space. The break value is the<br />
address of the first location beyond the end of the data segment.<br />
The amount of allocated space increases as the break value<br />
increases.<br />
Brk sets the break value to endds and changes the allocated space<br />
accordingly.<br />
Sbrk adds incr bytes to the break value and changes the allocated<br />
space accordingly. !ncr can be negative, in which case the<br />
amount of allocated space is decreased. Sbrk clears only the page<br />
actually allocated, starting at a page boundary.<br />
Brk and sbrk will fail without making any change in the allocated<br />
space if one or more of the following are true:<br />
Such a change would result in more space being allocated<br />
than is allowed by a system-imposed maximum (see<br />
ulimit(2)). jENOMEMI<br />
Such a change would result in the break value being<br />
greater than or equal to the start address of any attached<br />
shared memory segment (see shmop(2)).<br />
RETURN VALUE<br />
Upon successful completion, brk returns a value of 0 and sbrk<br />
returns the old break value. Otherwise, a value of -1 is returned<br />
and errno is set to indicate the error.<br />
SEE ALSO<br />
exec(2).<br />
- 1 -