shmdt()

NAME

shmdt() - detach shared memory segment

SYNOPSIS

#include <sys/shm.h>

int shmdt(const void *shmaddr)

DESCRIPTION

The shmdt(2) function detaches the shared memory segment at shmaddr from the address space of the calling process.

The function parameters are:

shmaddr
a pointer to a shared memory segment.

To delete a shared memory segment, use shmctl(2).

The header file <sys/shm.h> includes <sys/ipc.h>.

RETURN VALUE

On success, the shmdt(2) function returns 0 and decrements the value of shm_nattach in the data structure associated with the shared memory segment.

On failure, the function return s-1 and sets errno

ERRORS

The shmdt(2) function can fail for the following reasons:

[EINVAL]
Shmaddr does not point to the start of a data segment for a shared memory segment.
[ENOSYS]
The function isn't implemented.

SEE ALSO

shmat(2)

shmctl(2)

shmget(2)