diff options
author | Michael Kerrisk <mtk.manpages@gmail.com> | 2005-05-30 11:58:06 +0000 |
---|---|---|
committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2005-05-30 11:58:06 +0000 |
commit | 2202881e838358c38747d1687b8533596970c0dd (patch) | |
tree | 84e4b80dc3618e25a1dad1bbc4d20200467d67d5 | |
parent | 5bdccabd8ec82af36125c76239689d4b4b23298c (diff) |
Noted changes in permissions required for SHM_LOCK/SHM_UNLOCK.
-rw-r--r-- | man2/shmctl.2 | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/man2/shmctl.2 b/man2/shmctl.2 index 2668a56b..dd99438e 100644 --- a/man2/shmctl.2 +++ b/man2/shmctl.2 @@ -38,7 +38,7 @@ .\" 2005-04-25, mtk -- noted aberrant Linux behaviour w.r.t. new .\" attaches to a segment that has already been marked for deletion. .\" -.TH SHMCTL 2 2005-04-25 Linux 2.6.11" "Linux Programmer's Manual" +.TH SHMCTL 2 2005-05-30 Linux 2.6.11" "Linux Programmer's Manual" .SH NAME shmctl \- shared memory control .SH SYNOPSIS @@ -149,7 +149,16 @@ will be set. The caller \fImust\fP ensure that a segment is eventually destroyed; otherwise its pages that were faulted in will remain in memory or swap. .SS "Linux additions" -A privileged caller can prevent or allow swapping of a shared +The +.BR IPC_INFO , +.BR SHM_STAT +and +.B SHM_INFO +control calls are used by the +.BR ipcs (8) +program to provide information on allocated resources. +.PP +The caller can prevent or allow swapping of a shared memory segment with the following \fIcmd\fP values: .br .TP 12 @@ -167,14 +176,23 @@ will be set. .B SHM_UNLOCK Unlock the segment, allowing it to be swapped out. .PP -The -.BR IPC_INFO , -.BR SHM_STAT +In kernels before 2.6.10, only a privileged process +could employ +.B SHM_LOCK and -.B SHM_INFO -control calls are used by the -.BR ipcs (8) -program to provide information on allocated resources. +.BR SHM_UNLOCK . +Since kernel 2.6.10, an unprivileged process can employ these operations +if its effective UID matches the owner or creator UID of the segment, and +(for +.BR SHM_LOCK ) +the amount of memory to be locked falls within the +.BR RLIMIT_MEMLOCK +resource limit (see +.BR setrlimit (2)). +.\" There was some weirdness in 2.6.9: SHM_LOCK and SHM_UNLOCK could +.\" be applied to a segment, regardless of ownership of the segment. +.\" This was a botch-up in the move to RLIMIT_MEMLOCK, and was fixed +.\" in 2.6.10. MTK, May 2005 .SH "RETURN VALUE" On success, zero is returned. On error, \-1 is returned, and |