Chapter Contents

Previous

Next
shmdt

shmdt



Detach a Shared Memory Segment

Portability: UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
USAGE NOTES
EXAMPLE 1
EXAMPLE 2
RELATED FUNCTIONS


SYNOPSIS

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


DESCRIPTION

The shmdt function is used to detach a shared memory segment from a process. The segment is not destroyed, even if the calling process is the only process which has it attached. (See the shmget function description in section shmget for general information about shared memory segments.)

The addr argument specifies a pointer value to the location at which the shared segment is attached.


RETURN VALUE

shmdt returns 0 if successful, or -1 if unsuccessful.


USAGE NOTES

The shmdt function can only be used with MVS 5.2.2 or a later release.


EXAMPLE 1

Refer to shmat for an example that uses the functions shmat() , shmctl() , shmdt() , and shmget() to establish an IPC Client using a Shared Memory Segment.


EXAMPLE 2

Refer to shmat for an example that uses the functions shmat() , shmctl() , shmdt() , and shmget() to establish an IPC Server using a Shared Memory Segment.


RELATED FUNCTIONS

shmat , shmctl , shmget


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.