cfitsio  3390
Data Structures | Macros | Typedefs | Functions
drvrsmem.h File Reference
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <sys/fcntl.h>
Include dependency graph for drvrsmem.h:
This graph shows which files directly or indirectly include this file:

Data Structures

union  BLKHEAD
 
struct  BLKHEAD::BLKHEADstruct
 
struct  SHARED_GTABstruct
 
struct  SHARED_LTABstruct
 
union  semun
 
struct  DAL_SHM_SEGHEAD_STRUCT
 

Macros

#define SHARED_MAXSEG   (16) /* maximum number of shared memory blocks */
 
#define SHARED_KEYBASE   (14011963) /* base for shared memory keys, may be overriden by getenv */
 
#define SHARED_FDNAME   ("/tmp/.shmem-lockfile") /* template for lock file name */
 
#define SHARED_ENV_KEYBASE   ("SHMEM_LIB_KEYBASE") /* name of environment variable */
 
#define SHARED_ENV_MAXSEG   ("SHMEM_LIB_MAXSEG") /* name of environment variable */
 
#define SHARED_RDONLY   (0) /* flag for shared_(un)lock, lock for read */
 
#define SHARED_RDWRITE   (1) /* flag for shared_(un)lock, lock for write */
 
#define SHARED_WAIT   (0) /* flag for shared_lock, block if cannot lock immediate */
 
#define SHARED_NOWAIT   (2) /* flag for shared_lock, fail if cannot lock immediate */
 
#define SHARED_NOLOCK   (0x100) /* flag for shared_validate function */
 
#define SHARED_RESIZE   (4) /* flag for shared_malloc, object is resizeable */
 
#define SHARED_PERSIST   (8) /* flag for shared_malloc, object is not deleted after last proc detaches */
 
#define SHARED_INVALID   (-1) /* invalid handle for semaphore/shared memory */
 
#define SHARED_EMPTY   (0) /* entries for shared_used table */
 
#define SHARED_USED   (1)
 
#define SHARED_GRANUL   (16384) /* granularity of shared_malloc allocation = phys page size, system dependent */
 
#define SHARED_ID_0   ('J') /* first byte of identifier in BLKHEAD */
 
#define SHARED_ID_1   ('B') /* second byte of identifier in BLKHEAD */
 
#define BLOCK_REG   (0) /* value for tflag member of BLKHEAD */
 
#define BLOCK_SHARED   (1) /* value for tflag member of BLKHEAD */
 
#define SHARED_OK   (0)
 
#define SHARED_ERR_MIN_IDX   SHARED_BADARG
 
#define SHARED_ERR_MAX_IDX   SHARED_NORESIZE
 
#define DAL_SHM_FREE   (0)
 
#define DAL_SHM_USED   (1)
 
#define DAL_SHM_ID0   ('D')
 
#define DAL_SHM_ID1   ('S')
 
#define DAL_SHM_ID2   ('M')
 
#define DAL_SHM_SEGHEAD_ID   (0x19630114)
 
#define HAVE_FLOCK_T
 
#define HAVE_UNION_SEMUN
 

Typedefs

typedef void * SHARED_P
 
typedef struct SHARED_GTABstruct SHARED_GTAB
 
typedef struct SHARED_LTABstruct SHARED_LTAB
 
typedef struct flock flock_t
 
typedef struct DAL_SHM_SEGHEAD_STRUCT DAL_SHM_SEGHEAD
 

Functions

void shared_cleanup (void)
 
int shared_init (int debug_msgs)
 
int shared_recover (int id)
 
int shared_malloc (long size, int mode, int newhandle)
 
int shared_attach (int idx)
 
int shared_free (int idx)
 
SHARED_P shared_lock (int idx, int mode)
 
SHARED_P shared_realloc (int idx, long newsize)
 
int shared_size (int idx)
 
int shared_attr (int idx)
 
int shared_set_attr (int idx, int newattr)
 
int shared_unlock (int idx)
 
int shared_set_debug (int debug_msgs)
 
int shared_set_createmode (int mode)
 
int shared_list (int id)
 
int shared_uncond_delete (int id)
 
int shared_getaddr (int id, char **address)
 
int smem_init (void)
 
int smem_shutdown (void)
 
int smem_setoptions (int options)
 
int smem_getoptions (int *options)
 
int smem_getversion (int *version)
 
int smem_open (char *filename, int rwmode, int *driverhandle)
 
int smem_create (char *filename, int *driverhandle)
 
int smem_close (int driverhandle)
 
int smem_remove (char *filename)
 
int smem_size (int driverhandle, LONGLONG *size)
 
int smem_flush (int driverhandle)
 
int smem_seek (int driverhandle, LONGLONG offset)
 
int smem_read (int driverhandle, void *buffer, long nbytes)
 
int smem_write (int driverhandle, void *buffer, long nbytes)
 

Macro Definition Documentation

#define BLOCK_REG   (0) /* value for tflag member of BLKHEAD */
#define BLOCK_SHARED   (1) /* value for tflag member of BLKHEAD */
#define DAL_SHM_FREE   (0)
#define DAL_SHM_ID0   ('D')
#define DAL_SHM_ID1   ('S')
#define DAL_SHM_ID2   ('M')
#define DAL_SHM_SEGHEAD_ID   (0x19630114)
#define DAL_SHM_USED   (1)
#define HAVE_FLOCK_T
#define HAVE_UNION_SEMUN
#define SHARED_EMPTY   (0) /* entries for shared_used table */
#define SHARED_ENV_KEYBASE   ("SHMEM_LIB_KEYBASE") /* name of environment variable */
#define SHARED_ENV_MAXSEG   ("SHMEM_LIB_MAXSEG") /* name of environment variable */
#define SHARED_ERR_MAX_IDX   SHARED_NORESIZE
#define SHARED_ERR_MIN_IDX   SHARED_BADARG
#define SHARED_FDNAME   ("/tmp/.shmem-lockfile") /* template for lock file name */
#define SHARED_GRANUL   (16384) /* granularity of shared_malloc allocation = phys page size, system dependent */
#define SHARED_ID_0   ('J') /* first byte of identifier in BLKHEAD */
#define SHARED_ID_1   ('B') /* second byte of identifier in BLKHEAD */
#define SHARED_INVALID   (-1) /* invalid handle for semaphore/shared memory */
#define SHARED_KEYBASE   (14011963) /* base for shared memory keys, may be overriden by getenv */
#define SHARED_MAXSEG   (16) /* maximum number of shared memory blocks */
#define SHARED_NOLOCK   (0x100) /* flag for shared_validate function */
#define SHARED_NOWAIT   (2) /* flag for shared_lock, fail if cannot lock immediate */
#define SHARED_OK   (0)
#define SHARED_PERSIST   (8) /* flag for shared_malloc, object is not deleted after last proc detaches */
#define SHARED_RDONLY   (0) /* flag for shared_(un)lock, lock for read */
#define SHARED_RDWRITE   (1) /* flag for shared_(un)lock, lock for write */
#define SHARED_RESIZE   (4) /* flag for shared_malloc, object is resizeable */
#define SHARED_USED   (1)
#define SHARED_WAIT   (0) /* flag for shared_lock, block if cannot lock immediate */

Typedef Documentation

typedef struct flock flock_t
typedef void* SHARED_P

Function Documentation

int shared_attach ( int  idx)
int shared_attr ( int  idx)
void shared_cleanup ( void  )
int shared_free ( int  idx)
int shared_getaddr ( int  id,
char **  address 
)

Here is the caller graph for this function:

int shared_init ( int  debug_msgs)

Here is the caller graph for this function:

int shared_list ( int  id)

Here is the caller graph for this function:

SHARED_P shared_lock ( int  idx,
int  mode 
)
int shared_malloc ( long  size,
int  mode,
int  newhandle 
)
SHARED_P shared_realloc ( int  idx,
long  newsize 
)
int shared_recover ( int  id)

Here is the caller graph for this function:

int shared_set_attr ( int  idx,
int  newattr 
)
int shared_set_createmode ( int  mode)
int shared_set_debug ( int  debug_msgs)
int shared_size ( int  idx)
int shared_uncond_delete ( int  id)

Here is the caller graph for this function:

int shared_unlock ( int  idx)
int smem_close ( int  driverhandle)

Here is the caller graph for this function:

int smem_create ( char *  filename,
int *  driverhandle 
)

Here is the caller graph for this function:

int smem_flush ( int  driverhandle)

Here is the caller graph for this function:

int smem_getoptions ( int *  options)

Here is the caller graph for this function:

int smem_getversion ( int *  version)

Here is the caller graph for this function:

int smem_init ( void  )

Here is the caller graph for this function:

int smem_open ( char *  filename,
int  rwmode,
int *  driverhandle 
)

Here is the caller graph for this function:

int smem_read ( int  driverhandle,
void *  buffer,
long  nbytes 
)

Here is the caller graph for this function:

int smem_remove ( char *  filename)

Here is the caller graph for this function:

int smem_seek ( int  driverhandle,
LONGLONG  offset 
)

Here is the caller graph for this function:

int smem_setoptions ( int  options)

Here is the caller graph for this function:

int smem_shutdown ( void  )

Here is the caller graph for this function:

int smem_size ( int  driverhandle,
LONGLONG size 
)

Here is the caller graph for this function:

int smem_write ( int  driverhandle,
void *  buffer,
long  nbytes 
)

Here is the caller graph for this function: