| 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_CODE 2const 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
PR_SET_MM_START_CODE, |
| 10 |
PR_SET_MM_END_CODE |
| 11 |
\- |
| 12 |
modify kernel memory map descriptor fields |
| 13 |
.SH LIBRARY |
| 14 |
Standard C library |
| 15 |
.RI ( libc ,\~ \-lc ) |
| 16 |
.SH SYNOPSIS |
| 17 |
.nf |
| 18 |
.BR "#include <linux/prctl.h>" " /* Definition of " PR_* " constants */" |
| 19 |
.B #include <sys/prctl.h> |
| 20 |
.P |
| 21 |
.BI "int prctl(PR_SET_MM, PR_SET_MM_START_CODE, unsigned long " addr ", 0L, 0L);" |
| 22 |
.BI "int prctl(PR_SET_MM, PR_SET_MM_END_CODE, unsigned long " addr ", 0L, 0L);" |
| 23 |
.fi |
| 24 |
.SH DESCRIPTION |
| 25 |
.TP |
| 26 |
.B PR_SET_MM_START_CODE |
| 27 |
Set the address above which the program text can run. |
| 28 |
The corresponding memory area must be readable and executable, |
| 29 |
but not writable or shareable (see |
| 30 |
.BR mprotect (2) |
| 31 |
and |
| 32 |
.BR mmap (2) |
| 33 |
for more information). |
| 34 |
.TP |
| 35 |
.B PR_SET_MM_END_CODE |
| 36 |
Set the address below which the program text can run. |
| 37 |
The corresponding memory area must be readable and executable, |
| 38 |
but not writable or shareable. |
| 39 |
.SH RETURN VALUE |
| 40 |
On success, |
| 41 |
0 is returned. |
| 42 |
On error, \-1 is returned, and |
| 43 |
.I errno |
| 44 |
is set to indicate the error. |
| 45 |
.SH ERRORS |
| 46 |
.TP |
| 47 |
.B EINVAL |
| 48 |
.I addr |
| 49 |
is greater than |
| 50 |
.B TASK_SIZE |
| 51 |
(the limit on the size of the user address space for this architecture). |
| 52 |
.TP |
| 53 |
.B EINVAL |
| 54 |
The permissions of the corresponding memory area are not as required. |
| 55 |
.SH STANDARDS |
| 56 |
Linux. |
| 57 |
.SH HISTORY |
| 58 |
Linux 3.3. |
| 59 |
.\" commit 028ee4be34a09a6d48bdf30ab991ae933a7bc036 |
| 60 |
.SH SEE ALSO |
| 61 |
.BR prctl (2) |