summaryrefslogtreecommitdiff
path: root/src/libnml/os_intf/_shm.h
blob: 789a07997de5cd74236c59645aab5a3616b59a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/********************************************************************
* Description: _shm.h
*   Purely local shared memory functions-- converting System V
*   shared memory to POSIX shared memory required something
*   intermediate in System V IPC that returned a file descriptor
*   suitable for mmap(), and that something doesn't exist.
*
*   Derived from a work by Fred Proctor & Will Shackleford
*
* Author:
* License: LGPL Version 2
* System: Linux
*    
* Copyright (c) 2004 All rights reserved.
*
* Last change: 
********************************************************************/
#ifndef _SHAREDMEM_H
#define _SHAREDMEM_H

#include <sys/types.h>		/* key_t */
#include <stddef.h>		/* size_t */

#ifndef KEY_T_DEFINED
#define KEY_T_DEFINED
#endif /* KEY_T_DEFINED */

typedef struct {
    int id;
    void *addr;
    int create_errno;
    size_t size;
    int count;
    int created;
    int key;
    char name[64];
} shm_t;

#ifdef __cplusplus
extern "C" {
#endif
    extern shm_t *rcs_shm_open(key_t key, size_t size, int oflag,
	/* int mode */ ...);
    extern int rcs_shm_close(shm_t * shm);
    extern int rcs_shm_delete(shm_t * shm);
    extern int rcs_shm_nattch(shm_t * shm);

#ifdef __cplusplus
}
#endif
#endif