shmctl.2
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 2 代码 · 共 166 行
2
166 行
.\" SCCSID: @(#)shmctl.2 8.1 9/11/90.TH shmctl 2.SH Nameshmctl \- shared memory control operations.SH Syntax.nf.B #include <\fIsys/types.h\fP>.B #include <\fIsys/ipc.h\fP>.B #include <\fIsys/shm.h\fP>.PP.B int shmctl (\fIshmid, cmd, buf\fP).B int \fIshmid, cmd\fP;.B struct \fIshmid_ds *buf\fP;.fi.SH Description.NXR "shmctl system call".NXR "shmctl system cal" "plock system call".NXR "shmctl system call" "shmop system call".NXR "shared memory" "control operations"The.PN shmctlsystem callprovides a variety of shared memorycontrol operations, as specified by.IR cmd .The following .I cmdsare available:.NXR "shmctl system call" "commands".TP 15.B IPC_STATPlace the current value of each memberof the data structure associated with.I shmidinto the structure pointed to by .IR buf .The contents of this structure are defined in.MS intro 2 ..TP 15.B IPC_SETSet the value of the following membersof the data structure associated with.I shmidto the corresponding value foundin the structure pointed to by.IR buf :.EXshm_perm.uidshm_perm.gidshm_perm.mode /* only low 9 bits */.EE.RS 16.PPThis .I cmdcan only be executed by a processthat has an effective user ID equal toeither that of the superuser or to the value of.PN shm_perm.uidin the data structure associated with .I shmid..RE.TP 15.B IPC_RMIDRemove the shared memory identifier specified by .I shmidfrom the system and destroy the sharedmemory segment and data structureassociated with it. This.I cmdcan only be executed by a process thathas an effective user ID equal toeither that of the superuser or to the value of .PN shm_perm.uidin the data structure associated with.IR shmid ..TP 15.B SHM_LOCKLock the shared memory segment specified by.I shmidin memory.Lock prevents the shared memory segment from being swappedor paged. This .I cmdcan only be executed by a process that has an effective user ID equal tothe superuser..TP 15.B SHM_UNLOCKUnlock the shared memory segment specified by.I shmid.This .I cmdcan only be executed by a process that has an effective user ID equal tothe superuser..SH Return ValuesUpon successful completion, a value of zero (0) is returned.Otherwise, a value of \-1 is returned, and .I errno is set to indicated the error..SH Diagnostics.NXR "shmctl system call" "diagnostics"The.PN shmctlsystem callfails if any of the following is true:.TP 15[EINVAL]The.I shmidis not a valid shared memory identifier. .TP 15[EINVAL]The.I cmdis not a valid command. .TP 15[EACCES]The.I cmdis equal to IPC_STAT,and read permission isdenied to the calling process. For further information, see.MS errno 2 . .TP 15[EPERM]The.I cmdis equal to IPC_RMID or IPC_SET,and the effective user ID of thecalling process is not equal to that ofthe superuser or to the value of.PN shm_perm.uidin the data structure associated with.I shmid. .TP 15[EPERM]The.I cmdis equal to SHM_LOCKor SHM_UNLOCKand the effective user IDof the calling process is not equal to that of the superuser..TP 15[EINVAL]The.I cmdis equal to SHM_LOCK,and the shared memory segment is currently locked bythis process..TP 15[EINVAL]The.I cmdis equal to SHM_UNLOCK,and the shared memory segment specified by .I shmidis not currently locked in memory bythis process..TP 15[EFAULT]The.I bufpoints to an illegal address. .SH See Alsoshmget(2), shmop(2)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?