DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

dshm_map(3dshm)


dshm_map -- map DSHM buffer

Synopsis

   #include <dshm.h>
   

int dshm_map(dshm_handle_t handle, unsigned long buffer_index, const void** bufpp);

Description

dshm_map establishes a mapping to a specified buffer within the DSHM segment attached by handle. The buffer lies at byte offset (buffer_index * buffer_size) within the DSHM object (where buffer_size is as defined by the segment's creation by dshm_get). Upon successful return,*bufpp points to the mapped buffer. The application must initialize *bufpp to the value DSHM_NULL prior to its first use with dshm_map.

The established mapping can be used only by the calling process, except as permitted by use of dshm_updatetlb(3dshm).

If dshm_map returns an error, the map should be considered corrupt. An error indicates a bug, usually a DSHM usage bug in the application. The caller should immediately abort all processes using the map. The map needs to be destroyed and recreated in order to restart the application.

Return values

If dshm_map returns 0, the operation succeeded.

If dshm_map returns -1, an error occurred and the map should be considered corrupt. errno is set to identify the error.

Errors

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

EOVERFLOW
The reference count for a map slot exceeds the maximum concurrent mapping count for the map. This strongly suggests an imbalance in dshm_map and dshm_unmap operations.

EDOMAIN
The reference count for a map slot is negative. This strongly suggests an imbalance in dshm_map and dshm_unmap operations.

other
Some other internal inconsistency was discovered. For example, a system call to remap a map slot might have failed.

References

dshm_alignment(3dshm), dshm_attach(3dshm), dshm_bufindex(3dshm), dshm_control(3dshm), dshm_detach(3dshm), dshm_get(3dshm), dshm_minmapsize(3dshm), dshm_reattach(3dshm), dshm_unmap(3dshm), dshm_updatetlb(3dshm)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004