-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
.\" Copyright (c) 1993 Michael Haardt
.\" (michael@moria.de),
.\" Fri Apr 2 11:32:09 MET DST 1993
.\"
+.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
-.\" License along with this manual; if not, write to the Free
-.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
-.\" USA.
+.\" License along with this manual; if not, see
+.\" <http://www.gnu.org/licenses/>.
+.\" %%%LICENSE_END
.\"
.\" Modified Wed Jul 21 19:52:58 1993 by Rik Faith <faith@cs.unc.edu>
.\" Modified Sun Aug 21 17:40:38 1994 by Rik Faith <faith@cs.unc.edu>
.\"
-.TH BRK 2 2008-06-18 "Linux" "Linux Programmer's Manual"
+.TH BRK 2 2014-08-19 "Linux" "Linux Programmer's Manual"
.SH NAME
brk, sbrk \- change data segment size
.SH SYNOPSIS
.BR feature_test_macros (7)):
.in
.sp
-.ad l
.BR brk (),
.BR sbrk ():
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500
+.ad l
+.RS 4
+.PD 0
+.TP 4
+Since glibc 2.12:
+.nf
+_BSD_SOURCE || _SVID_SOURCE ||
+ (_XOPEN_SOURCE\ >=\ 500 ||
+ _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
+ !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600)
+.TP 4
+.fi
+Before glibc 2.12:
+_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
+_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
+.PD
+.RE
.ad b
.SH DESCRIPTION
.BR brk ()
with an
.I increment
of 0 can be used to find the current location of the program break.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
On success,
.BR brk ()
returns zero.
.I errno
is set to
.BR ENOMEM .
-(But see \fILinux Notes\fP below.)
On success,
.BR sbrk ()
.I errno
is set to
.BR ENOMEM .
-.SH "CONFORMING TO"
+.SH CONFORMING TO
4.3BSD; SUSv1, marked LEGACY in SUSv2, removed in POSIX.1-2001.
.\"
.\" .BR brk ()
.\" \fIptrdiff_t\fP (libc4, libc5, ulibc, glibc 2.0, 2.1),
.\" \fIintptr_t\fP (e.g., XPGv5, AIX, SunOS 5.8, 5.9, FreeBSD 4.7, NetBSD 1.6,
.\" Tru64 5.1, glibc2.2).
-.SS Linux Notes
+.SS C library/kernel ABI differences
The return value described above for
.BR brk ()
is the behavior provided by the glibc wrapper function for the Linux
.BR brk ()
system call, and does some internal bookkeeping so that it can
return the old break value.
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR execve (2),
.BR getrlimit (2),
.BR end (3),
.BR malloc (3)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.