| 1 |
.\" Copyright 2021, Colin Cross <[email protected]> |
| 2 |
.\" Copyright 2023, Nick Gregory <[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_VMA 2const 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
PR_SET_VMA |
| 10 |
\- |
| 11 |
set an attribute for virtual memory areas |
| 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_VMA, long " attr ", unsigned long " addr \ |
| 21 |
", unsigned long " size , |
| 22 |
.BI " const char *_Nullable " val ); |
| 23 |
.fi |
| 24 |
.SH DESCRIPTION |
| 25 |
Sets an attribute specified in |
| 26 |
.I attr |
| 27 |
for virtual memory areas starting from the address specified in |
| 28 |
.I addr |
| 29 |
and spanning the size specified in |
| 30 |
.IR size . |
| 31 |
.I val |
| 32 |
specifies the value of the attribute to be set. |
| 33 |
.P |
| 34 |
Note that assigning an attribute to a virtual memory area |
| 35 |
might prevent it from being merged with adjacent virtual memory areas |
| 36 |
due to the difference in that attribute's value. |
| 37 |
.P |
| 38 |
Currently, |
| 39 |
.I attr |
| 40 |
must be one of: |
| 41 |
.TP |
| 42 |
.B PR_SET_VMA_ANON_NAME |
| 43 |
Set a name for anonymous virtual memory areas. |
| 44 |
.I val |
| 45 |
should be a pointer to a null-terminated string containing the name. |
| 46 |
The name length including null byte cannot exceed 80 bytes. |
| 47 |
If |
| 48 |
.I val |
| 49 |
is NULL, the name of the appropriate anonymous virtual memory areas |
| 50 |
will be reset. |
| 51 |
The name can contain only printable ascii characters |
| 52 |
.RB ( isprint (3)), |
| 53 |
except |
| 54 |
.BR \[aq][\[aq] , |
| 55 |
.BR \[aq]]\[aq] , |
| 56 |
.BR \[aq]\[rs]\[aq] , |
| 57 |
.BR \[aq]$\[aq] , |
| 58 |
and |
| 59 |
.BR \[aq]\[ga]\[aq] . |
| 60 |
.SH RETURN VALUE |
| 61 |
On success, |
| 62 |
0 is returned. |
| 63 |
On error, \-1 is returned, and |
| 64 |
.I errno |
| 65 |
is set to indicate the error. |
| 66 |
.SH ERRORS |
| 67 |
.TP |
| 68 |
.B EINVAL |
| 69 |
.I attr |
| 70 |
is not a valid attribute. |
| 71 |
.TP |
| 72 |
.B EINVAL |
| 73 |
.I addr |
| 74 |
is an invalid address. |
| 75 |
.SH STANDARDS |
| 76 |
Linux. |
| 77 |
.SH HISTORY |
| 78 |
Linux 5.17. |
| 79 |
.\" Commit 9a10064f5625d5572c3626c1516e0bebc6c9fe9b |
| 80 |
.SH SEE ALSO |
| 81 |
.BR prctl (2) |