next up previous contents
Next: shmtool: An interactive shared Up: 6.4.4 Shared Memory Previous: SYSTEM CALL: shmctl()

SYSTEM CALL: shmdt()

  SYSTEM CALL: shmdt();

  PROTOTYPE: int shmdt ( char *shmaddr );
    RETURNS: -1 on error: errno = EINVAL (Invalid attach address passed)

After a shared memory segment is no longer needed by a process, it should be detached by calling this system call. As mentioned earlier, this is not the same as removing the segment from the kernel! After a detach is successful, the shm_nattch member of the associates shmid_ds structure is decremented by one. When this value reaches zero (0), the kernel will physically remove the segment.

Converted on:
Fri Mar 29 14:43:04 EST 1996