aboutsummaryrefslogtreecommitdiff
path: root/src/include/port/beos.h
blob: 9c71f80f568883cc358dd6ce1b92bb6b1fd4d32b (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include <kernel/OS.h>
#include <kernel/image.h>
#include <sys/ioctl.h>

#define AF_UNIX		10			/* no domain sockets on BeOS */

/* Beos doesn't have all the required getrusage fields */
#undef HAVE_GETRUSAGE

/* SYS V emulation */

#undef HAVE_UNION_SEMUN
#define HAVE_UNION_SEMUN 1

#define IPC_RMID 256
#define IPC_CREAT 512
#define IPC_EXCL 1024
#define IPC_PRIVATE 234564
#define IPC_NOWAIT	2048
#define IPC_STAT 4096

#define EACCESS 2048
#define EIDRM 4096

#define SETALL 8192
#define GETNCNT 16384
#define GETVAL 65536
#define SETVAL 131072
#define GETPID 262144

union semun
{
	int			val;
	struct semid_ds *buf;
	unsigned short *array;
};

struct sembuf
{
	int			sem_flg;
	int			sem_op;
	int			sem_num;
};

struct shmid_ds
{
	int			dummy;
	int			shm_nattch;
};

int			semctl(int semId, int semNum, int flag, union semun);
int			semget(int semKey, int semNum, int flags);
int			semop(int semId, struct sembuf * sops, int flag);

int			shmdt(char *shmaddr);
int		   *shmat(int memId, int m1, int m2);
int			shmctl(int shmid, int flag, struct shmid_ds * dummy);
int			shmget(int memKey, int size, int flag);


/* Support functions */

/* Specific beos action made on postgres/postmaster startup */
void		beos_startup(int argc, char **argv);

/* Load a shared library */
image_id	beos_dl_open(char *filename);

/* Find symbol */
void		beos_dl_sym(image_id im, char *symname, void **fptr);

/* UnLoad a shared library */
status_t	beos_dl_close(image_id im);

/* Specific beos action made on backend startup */
void		beos_before_backend_startup(void);

/* Specific beos action made on backend startup */
void		beos_backend_startup(void);

/* Specific beos action made on backend startup failure*/
void		beos_backend_startup_failed(void);