| 1 |
.\" Copyright 2012, Cyrill Gorcunov <[email protected]> |
| 2 |
.\" Copyright 2012-2015, Michael Kerrisk <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 6 |
.\" |
| 7 |
.TH PR_SET_MM_START_BRK 2const 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
PR_SET_MM_START_BRK |
| 10 |
\- |
| 11 |
modify kernel memory map descriptor fields |
| 12 |
.SH LIBRARY |
| 13 |
Standard C library |
| 14 |
.RI ( libc ,\~ \-lc ) |
| 15 |
.SH SYNOPSIS |
| 16 |
.nf |
| 17 |
.BR "#include <linux/prctl.h>" " /* Definition of " PR_* " constants */" |
| 18 |
.B #include <sys/prctl.h> |
| 19 |
.P |
| 20 |
.BI "int prctl(PR_SET_MM, PR_SET_MM_START_BRK, unsigned long " addr ", 0L, 0L);" |
| 21 |
.fi |
| 22 |
.SH DESCRIPTION |
| 23 |
Set the address above which the program heap can be expanded with |
| 24 |
.BR brk (2) |
| 25 |
call. |
| 26 |
.P |
| 27 |
The address must be greater than the ending address of |
| 28 |
the current program data segment. |
| 29 |
In addition, |
| 30 |
the combined size of the resulting heap and the data segment |
| 31 |
can't exceed the |
| 32 |
.B RLIMIT_DATA |
| 33 |
resource limit (see |
| 34 |
.BR setrlimit (2)). |
| 35 |
.SH RETURN VALUE |
| 36 |
On success, |
| 37 |
0 is returned. |
| 38 |
On error, \-1 is returned, and |
| 39 |
.I errno |
| 40 |
is set to indicate the error. |
| 41 |
.SH ERRORS |
| 42 |
.TP |
| 43 |
.B EINVAL |
| 44 |
.I addr |
| 45 |
is greater than |
| 46 |
.B TASK_SIZE |
| 47 |
(the limit on the size of the user address space for this architecture). |
| 48 |
.TP |
| 49 |
.B EINVAL |
| 50 |
.I addr |
| 51 |
is less than or equal to the end of the data segment |
| 52 |
or specifies a value that would cause the |
| 53 |
.B RLIMIT_DATA |
| 54 |
resource limit to be exceeded. |
| 55 |
.SH STANDARDS |
| 56 |
Linux. |
| 57 |
.SH HISTORY |
| 58 |
Linux 3.3. |
| 59 |
.\" commit 028ee4be34a09a6d48bdf30ab991ae933a7bc036 |
| 60 |
.SH SEE ALSO |
| 61 |
.BR prctl (2), |
| 62 |
.BR PR_SET_MM (2const) |