mirror of https://github.com/mkerrisk/man-pages
brk.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
b3b5781ebd
commit
7cbe630709
18
man2/brk.2
18
man2/brk.2
|
@ -31,16 +31,16 @@
|
||||||
brk, sbrk \- change data segment size
|
brk, sbrk \- change data segment size
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B #include <unistd.h>
|
.B #include <unistd.h>
|
||||||
.sp
|
.PP
|
||||||
.BI "int brk(void *" addr );
|
.BI "int brk(void *" addr );
|
||||||
.sp
|
.PP
|
||||||
.BI "void *sbrk(intptr_t " increment );
|
.BI "void *sbrk(intptr_t " increment );
|
||||||
.sp
|
.PP
|
||||||
.in -4n
|
.in -4n
|
||||||
Feature Test Macro Requirements for glibc (see
|
Feature Test Macro Requirements for glibc (see
|
||||||
.BR feature_test_macros (7)):
|
.BR feature_test_macros (7)):
|
||||||
.in
|
.in
|
||||||
.sp
|
.PP
|
||||||
.BR brk (),
|
.BR brk (),
|
||||||
.BR sbrk ():
|
.BR sbrk ():
|
||||||
.ad l
|
.ad l
|
||||||
|
@ -83,14 +83,14 @@ uninitialized data segment).
|
||||||
Increasing the program break has the effect of
|
Increasing the program break has the effect of
|
||||||
allocating memory to the process;
|
allocating memory to the process;
|
||||||
decreasing the break deallocates memory.
|
decreasing the break deallocates memory.
|
||||||
|
.PP
|
||||||
.BR brk ()
|
.BR brk ()
|
||||||
sets the end of the data segment to the value specified by
|
sets the end of the data segment to the value specified by
|
||||||
.IR addr ,
|
.IR addr ,
|
||||||
when that value is reasonable, the system has enough memory,
|
when that value is reasonable, the system has enough memory,
|
||||||
and the process does not exceed its maximum data size (see
|
and the process does not exceed its maximum data size (see
|
||||||
.BR setrlimit (2)).
|
.BR setrlimit (2)).
|
||||||
|
.PP
|
||||||
.BR sbrk ()
|
.BR sbrk ()
|
||||||
increments the program's data space by
|
increments the program's data space by
|
||||||
.I increment
|
.I increment
|
||||||
|
@ -108,7 +108,7 @@ On error, \-1 is returned, and
|
||||||
.I errno
|
.I errno
|
||||||
is set to
|
is set to
|
||||||
.BR ENOMEM .
|
.BR ENOMEM .
|
||||||
|
.PP
|
||||||
On success,
|
On success,
|
||||||
.BR sbrk ()
|
.BR sbrk ()
|
||||||
returns the previous program break.
|
returns the previous program break.
|
||||||
|
@ -137,7 +137,7 @@ the
|
||||||
.BR malloc (3)
|
.BR malloc (3)
|
||||||
memory allocation package is the
|
memory allocation package is the
|
||||||
portable and comfortable way of allocating memory.
|
portable and comfortable way of allocating memory.
|
||||||
|
.PP
|
||||||
Various systems use various types for the argument of
|
Various systems use various types for the argument of
|
||||||
.BR sbrk ().
|
.BR sbrk ().
|
||||||
Common are \fIint\fP, \fIssize_t\fP, \fIptrdiff_t\fP, \fIintptr_t\fP.
|
Common are \fIint\fP, \fIssize_t\fP, \fIptrdiff_t\fP, \fIintptr_t\fP.
|
||||||
|
@ -163,7 +163,7 @@ The glibc wrapper function does some work
|
||||||
(i.e., checks whether the new break is less than
|
(i.e., checks whether the new break is less than
|
||||||
.IR addr )
|
.IR addr )
|
||||||
to provide the 0 and \-1 return values described above.
|
to provide the 0 and \-1 return values described above.
|
||||||
|
.PP
|
||||||
On Linux,
|
On Linux,
|
||||||
.BR sbrk ()
|
.BR sbrk ()
|
||||||
is implemented as a library function that uses the
|
is implemented as a library function that uses the
|
||||||
|
|
Loading…
Reference in New Issue