|
Next: SYSTEM CALL: shmdt() Up: 6.4.4 Shared Memory Previous: SYSTEM CALL: shmat()
SYSTEM CALL: shmctl()
SYSTEM CALL: shmctl(); PROTOTYPE: int shmctl ( int shmqid, int cmd, struct shmid_ds *buf ); RETURNS: 0 on success -1 on error: errno = EACCES (No read permission and cmd is IPC_STAT) EFAULT (Address pointed to by buf is invalid with IPC_SET and IPC_STAT commands) EIDRM (Segment was removed during retrieval) EINVAL (shmqid invalid) EPERM (IPC_SET or IPC_RMID command was issued, but calling process does not have write (alter) access to the segment) NOTES: This particular call is modeled directly after the msgctl call for message queues. In light of this fact, it won't be discussed in too much detail. Valid command values are:
The IPC_RMID command doesn't actually remove a segment from the kernel. Rather, it marks the segment for removal. The actual removal itself occurs when the last process currently attached to the segment has properly detached it. Of course, if no processes are currently attached to the segment, the removal seems immediate. To properly detach a shared memory segment, a process calls the shmdt system call.
Converted on: Fri Mar 29 14:43:04 EST 1996 |
|||||||||||||||||
With any suggestions or questions please feel free to contact us |