shmdt
shmdt is a system call used in the System V IPC shared memory interface to detach a previously attached shared memory segment from the calling process’s address space. It is invoked after a successful shmat, which attaches a segment at a specific address. The detachment is per-process: once detached, the process can no longer access that memory region through the old pointer, though the underlying segment may still exist if other processes are attached or if the segment has not been marked for deletion.
The function signature is int shmdt(const void *shmaddr). On success, it returns 0. On error, it returns
Detachment does not remove the shared memory segment from the system. The segment remains in the kernel
Context and usage: shmdt is part of the traditional System V IPC API, alongside shmget (to create