|
|
1.1 root 1: /*
2: * /usr/include/sys/shm.h
3: *
4: * Shared memory support.
5: *
6: * Revised: Thu Jul 15 14:05:25 1993 CDT
7: */
8: #ifndef __SYS_SHM_H__
9: #define __SYS_SHM_H__
10: /*
11: ** IPC Shared Memory Facility.
12: */
13: #include <sys/ipc.h>
14: #include <common/_time.h>
15:
16: extern int shmfd; /* file descriptor to access shared memory */
17:
18: /*
19: ** Permission Definitions.
20: */
21: #define SHM_R 0400 /* read permission */
22: #define SHM_W 0200 /* write permission */
23:
24: /*
25: ** ipc_perm Mode Definitions.
26: */
27: #define SHM_CLEAR 01000 /* clear segment on next attach */
28: #define SHM_DEST 02000 /* destroy segment when # attached = 0 */
29:
30: /*
31: ** Message Operations Flags.
32: */
33: #define SHM_RDONLY 010000 /* attach read-only (else read-write) */
34: #define SHM_RND 020000 /* round attach address to SHMLBA */
35:
36: /*
37: * Shared memory control operations (are not included in iBCS2)
38: * COHERENT 4.0.x does not use a swapper.
39: */
40: #define SHM_LOCK 3 /* lock shared memory segment in core */
41: #define SHM_UNLOCK 4 /* unlock shared memory segment */
42:
43: #if _I386
44:
45: /*
46: ** There is a shared mem id data structure for each segment in the system.
47: */
48: struct shmid_ds {
49: struct ipc_perm shm_perm; /* operation permission struct */
50: int shm_segsz; /* segment size */
51: unsigned short shm_cpid; /* pid of creator */
52: unsigned short shm_lpid; /* pid of last shmop */
53: unsigned short shm_nattch; /* current # attached */
54: time_t shm_atime; /* last shmat time */
55: time_t shm_dtime; /* last shmdt time */
56: time_t shm_ctime; /* last change time */
57: };
58:
59: #ifdef __KERNEL__
60:
61: /* Patchable kernel values. */
62:
63: extern int SHMMAX; /* Max size in bytes of shared memory segment */
64: /* Not more than 4 Megs, please! */
65:
66: extern int SHMMNI; /* Maximum # of shared memory segments, systemwide */
67:
68: #endif
69:
70: #else /* !_I386 */
71:
72: struct shmid_ds {
73: struct ipc_perm shm_perm; /* operation permission struct */
74: int shm_segsz; /* segment size */
75: unsigned short shm_lpid; /* pid of last shmop */
76: unsigned short shm_cpid; /* pid of creator */
77: unsigned short shm_nattch; /* current # attached */
78: unsigned short shm_cnattch; /* in memory # attached */
79: time_t shm_atime; /* last shmat time */
80: time_t shm_dtime; /* last shmdt time */
81: time_t shm_ctime; /* last change time */
82: };
83:
84: /*
85: ** Ioctl Commands issued to Shared Memory Device Driver (on Coherent).
86: */
87: #define SHMIOC ('H'<<8)
88: #define SHMCTL (SHMIOC+'C')
89: #define SHMGET (SHMIOC+'G')
90: #define SHMAT (SHMIOC+'A')
91: #define SHMDT (SHMIOC+'D')
92:
93:
94: #endif /* !_I386 */
95:
96: #endif /* !defined(__SYS_SHM_H__) */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.