DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

dshm_attach(DSHM)


dshm_attach -- attach DSHM segment

Synopsis

   #include <dshm.h>
   

dshm_handle_t dshm_attach (int dshmid, int dshmflgs, unsigned long * max_mappings);

Description

dshm_attach attaches the designated DSHM segment to the calling process, placing the map at the logical address assigned by dshm_get(DSHM), and allocating and initializing the per-attach management data.

Upon successful return, *max_mappings indicates the maximum concurrent mappings the application can safely use (total across all attached processes) without deadlocking.

Return values

If dshm_attach returns DSHM_NULL_HANDLE, an error occurred. errno is set to identify the error.

Otherwise, dshm_attach returns an opaque handle for use in subsequent operations on the attached segment.

Errors

In the following conditions, dshm_attach fails and sets errno to:

EBUSY
Segment is not initialized. Initialization (by dshm_get(DSHM)) is still in progress or was terminated prematurely.

EINVAL
Illegal flags in dshmflgs.

EINVAL
Attach failed due to address space conflict.

ENOMEM
Insufficient resources to allocate per-attach management structure(s).

EINVAL
dshmid is not a valid dynamically mapped shared memory identifier.

EACCES
Operation permission is denied to the calling process.

ENOMEM
The available data space is not large enough to accommodate the shared memory segment.

EMFILE
The number of dynamically mapped shared memory segments attached to the calling process would exceed the system-imposed limit.

References

dshm_alignment(DSHM), dshm_bufindex(DSHM), dshm_control(DSHM), dshm_detach(DSHM), dshm_get(DSHM), dshm_map(DSHM), dshm_minmapsize(DSHM), dshm_reattach(DSHM), dshm_unmap(DSHM), dshm_updatetlb(DSHM)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005