HPlogo MPE/iX Developer's Kit Reference Manual Volume 2: HP 3000 MPE/iX Computer Systems > Chapter 2 SVID IPC Library Function Descriptions

shmdt

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Detaches a process from a shared memory area.

Syntax

   #include <sys/types.h>

   #include <sys/ipc.h>

   #include <sys/shm.h>



   int shmdt (char *shmaddr);

Parameters

shmaddr

Passes the address of the shared memory area (returned from a call to shmat()).

Return Values

0

Success.

-1

An error occurred, and errno is set to indicate the error condition.

Description

The shmdt() function detaches a shared memory area from the calling process's data area. The address of the shared memory area is specified by shmaddr (returned from a call to shmat()).

Implementation Considerations

None.

Errors

If an error occurs, errno is set to one of the following values.

EINVALCAUSE shmaddr is not the data area start address of a shared memory area.
 ACTION Check to see that shmaddr is equal to the value returned by a previous shmat() call.
ESYSERRCAUSE An operating system error occurred that does not map directly to any of the above errors.
 ACTION Examine the MPE/iX process error stack for the type of system error.

See Also

shmat(), shmctl(), shmget(), SVID2 (Section 12)

Feedback to webmaster