Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

shmat(2)

shmctl(2)

shmget(2)

shmid_ds(4)

shmdt(2)  —  System Calls

NAME

shmdt − Detaches a shared memory region

SYNOPSIS

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
int shmdt(
const void ∗addr);

PARAMETERS

addrSpecifies the starting virtual address for the shared memory region to be detached.  This is the address returned by a previous shmat() call. 

DESCRIPTION

The shmdt() function detaches the shared memory region at the address specified by the addr parameter.  Other instances of the region attached at other addresses are unaffected. 

RETURN VALUES

Upon successful completion, the shmdt() function returns 0 (zero).  Upon failure, -1 is returned and errno is set to indicate the error. 

ERRORS

If the shmdt() function fails, the shared memory segment is not detached and errno may be set to the following value:

[EINVAL]The addr parameter does not specify the starting address of a shared memory region. 

RELATED INFORMATION

Functions: shmat(2), shmctl(2), shmget(2)

Data structures: shmid_ds(4)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026