2 |
7u83 |
1 |
# Crown Copyright (c) 1997
|
|
|
2 |
#
|
|
|
3 |
# This TenDRA(r) Computer Program is subject to Copyright
|
|
|
4 |
# owned by the United Kingdom Secretary of State for Defence
|
|
|
5 |
# acting through the Defence Evaluation and Research Agency
|
|
|
6 |
# (DERA). It is made available to Recipients with a
|
|
|
7 |
# royalty-free licence for its use, reproduction, transfer
|
|
|
8 |
# to other parties and amendment for any purpose not excluding
|
|
|
9 |
# product development provided that any such use et cetera
|
|
|
10 |
# shall be deemed to be acceptance of the following conditions:-
|
|
|
11 |
#
|
|
|
12 |
# (1) Its Recipients shall ensure that this Notice is
|
|
|
13 |
# reproduced upon any copies or amended versions of it;
|
|
|
14 |
#
|
|
|
15 |
# (2) Any amended version of it shall be clearly marked to
|
|
|
16 |
# show both the nature of and the organisation responsible
|
|
|
17 |
# for the relevant amendment or amendments;
|
|
|
18 |
#
|
|
|
19 |
# (3) Its onward transfer from a recipient to another
|
|
|
20 |
# party shall be deemed to be that party's acceptance of
|
|
|
21 |
# these conditions;
|
|
|
22 |
#
|
|
|
23 |
# (4) DERA gives no warranty or assurance as to its
|
|
|
24 |
# quality or suitability for any purpose and DERA accepts
|
|
|
25 |
# no liability whatsoever in relation to any use to which
|
|
|
26 |
# it may be put.
|
|
|
27 |
#
|
|
|
28 |
+USE "xpg3", "sys/types.h" ;
|
|
|
29 |
|
|
|
30 |
/* These types have been abstracted */
|
|
|
31 |
+IF %% __STRICT_XPG3 %%
|
|
|
32 |
+TYPEDEF uid_t ~ipc_uid_t ;
|
|
|
33 |
+TYPEDEF gid_t ~ipc_gid_t ;
|
|
|
34 |
+TYPEDEF mode_t ~ipc_mode_t ;
|
|
|
35 |
+ELSE
|
|
|
36 |
+TYPE ( arith ) ~ipc_uid_t.1 ;
|
|
|
37 |
+TYPE ( arith ) ~ipc_gid_t.1 ;
|
|
|
38 |
+TYPE ( arith ) ~ipc_mode_t.1 ;
|
|
|
39 |
+MACRO uid_t __ipc_uid2uid ( ~ipc_uid_t ) ;
|
|
|
40 |
+MACRO ~ipc_uid_t __uid2ipc_uid ( uid_t ) ;
|
|
|
41 |
+MACRO gid_t __ipc_gid2gid ( ~ipc_gid_t ) ;
|
|
|
42 |
+MACRO ~ipc_gid_t __gid2ipc_gid ( gid_t ) ;
|
|
|
43 |
+MACRO mode_t __ipc_mode2mode ( ~ipc_mode_t ) ;
|
|
|
44 |
+MACRO ~ipc_mode_t __mode2ipc_mode ( mode_t ) ;
|
|
|
45 |
+IFNDEF ~building_libs
|
|
|
46 |
%%
|
|
|
47 |
#pragma accept conversion __ipc_uid2uid
|
|
|
48 |
#pragma accept conversion __uid2ipc_uid
|
|
|
49 |
#pragma accept conversion __ipc_gid2gid
|
|
|
50 |
#pragma accept conversion __gid2ipc_gid
|
|
|
51 |
#pragma accept conversion __ipc_mode2mode
|
|
|
52 |
#pragma accept conversion __mode2ipc_mode
|
|
|
53 |
%%
|
|
|
54 |
%%%
|
|
|
55 |
#include <sys/ipc.h>
|
|
|
56 |
#define __ipc_uid2uid( X ) ( uid_t ) ( X )
|
|
|
57 |
#define __uid2ipc_uid( X ) ( __local_ipc_uid_t ) ( X )
|
|
|
58 |
#define __ipc_gid2gid( X ) ( gid_t ) ( X )
|
|
|
59 |
#define __gid2ipc_gid( X ) ( __local_ipc_gid_t ) ( X )
|
|
|
60 |
#define __ipc_mode2mode( X ) ( mode_t ) ( X )
|
|
|
61 |
#define __mode2ipc_mode( X ) ( __local_ipc_mode_t ) ( X )
|
|
|
62 |
%%%
|
|
|
63 |
+ENDIF
|
|
|
64 |
+ENDIF
|
|
|
65 |
|
|
|
66 |
+FIELD struct ipc_perm {
|
|
|
67 |
~ipc_uid_t uid ;
|
|
|
68 |
~ipc_gid_t gid ;
|
|
|
69 |
~ipc_uid_t cuid ;
|
|
|
70 |
~ipc_gid_t cgid ;
|
|
|
71 |
~ipc_mode_t mode ;
|
|
|
72 |
} ;
|
|
|
73 |
|
|
|
74 |
+CONST int IPC_CREAT, IPC_EXCL, IPC_NOWAIT ;
|
|
|
75 |
+CONST key_t IPC_PRIVATE ;
|
|
|
76 |
+CONST int IPC_RMID, IPC_SET, IPC_STAT ;
|