Ticket #2657: shm.h

File shm.h, 1.7 KB (added by michaelvoliveira, 14 years ago)

code taken from postgresql-8.1.20

Line 
1#include <kernel/OS.h>
2#include <kernel/image.h>
3#include <sys/ioctl.h>
4
5#define AF_UNIX 10 /* no domain sockets on BeOS */
6
7/* Beos doesn't have all the required getrusage fields */
8#undef HAVE_GETRUSAGE
9
10/* SYS V emulation */
11
12#undef HAVE_UNION_SEMUN
13#define HAVE_UNION_SEMUN 1
14
15#define IPC_RMID 256
16#define IPC_CREAT 512
17#define IPC_EXCL 1024
18#define IPC_PRIVATE 234564
19#define IPC_NOWAIT 2048
20#define IPC_STAT 4096
21
22#define EACCESS 2048
23#define EIDRM 4096
24
25#define SETALL 8192
26#define GETNCNT 16384
27#define GETVAL 65536
28#define SETVAL 131072
29#define GETPID 262144
30
31union semun
32{
33 int val;
34 struct semid_ds *buf;
35 unsigned short *array;
36};
37
38struct sembuf
39{
40 int sem_flg;
41 int sem_op;
42 int sem_num;
43};
44
45struct shmid_ds
46{
47 int dummy;
48 int shm_nattch;
49};
50
51int semctl(int semId, int semNum, int flag, union semun);
52int semget(int semKey, int semNum, int flags);
53int semop(int semId, struct sembuf * sops, int flag);
54
55int shmdt(char *shmaddr);
56int *shmat(int memId, int m1, int m2);
57int shmctl(int shmid, int flag, struct shmid_ds * dummy);
58int shmget(int memKey, int size, int flag);
59
60
61/* Support functions */
62
63/* Specific beos action made on postgres/postmaster startup */
64void beos_startup(int argc, char **argv);
65
66/* Load a shared library */
67image_id beos_dl_open(char *filename);
68
69/* Find symbol */
70void beos_dl_sym(image_id im, char *symname, void **fptr);
71
72/* UnLoad a shared library */
73status_t beos_dl_close(image_id im);
74
75/* Specific beos action made on backend startup */
76void beos_before_backend_startup(void);
77
78/* Specific beos action made on backend startup */
79void beos_backend_startup(void);
80
81/* Specific beos action made on backend startup failure*/
82void beos_backend_startup_failed(void);