• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2016 Xiao Yang <yangx.jy@cn.fujitsu.com>
3  *
4  * This program is free software;  you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY;  without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
12  * the GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.
16  */
17 
18 /*
19  * common definitions for the IPC system calls.
20  */
21 
22 #ifndef __LIBNEWIPC_H
23 #define __LIBNEWIPC_H	1
24 
25 #define MSG_RD	0400
26 #define MSG_WR	0200
27 #define MSG_RW	(MSG_RD | MSG_WR)
28 #define MSGSIZE	1024
29 #define MSGTYPE	1
30 #define NR_MSGQUEUES	16
31 #define min(a, b)	(((a) < (b)) ? (a) : (b))
32 
33 #define SEM_RD	0400
34 #define SEM_ALT	0200
35 #define SEM_RA	(SEM_RD | SEM_ALT)
36 #define PSEMS	10
37 
38 #define SHM_RD	0400
39 #define SHM_WR	0200
40 #define SHM_RW	(SHM_RD | SHM_WR)
41 #define SHM_SIZE	2048
42 #define INT_SIZE	4
43 #define MODE_MASK	0x01FF
44 
45 key_t getipckey(const char *file, const int lineno);
46 #define GETIPCKEY() \
47 	getipckey(__FILE__, __LINE__)
48 
49 int get_used_queues(const char *file, const int lineno);
50 #define GET_USED_QUEUES() \
51 	get_used_queues(__FILE__, __LINE__)
52 
53 #endif /* newlibipc.h */
54