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 |
+USE "xpg3", "sys/ipc.h" ;
|
|
|
30 |
|
|
|
31 |
+SUBSET "sem_proto" := {
|
|
|
32 |
+USE "xpg3", "sys/types.h" ;
|
|
|
33 |
+USE "xpg3", "sys/ipc.h" ;
|
|
|
34 |
|
|
|
35 |
+CONST short SEM_UNDO ;
|
|
|
36 |
+CONST int GETNCNT, GETPID, GETVAL, GETALL, GETZCNT, SETVAL, SETALL ;
|
|
|
37 |
|
|
|
38 |
+FIELD struct semid_ds {
|
|
|
39 |
struct ipc_perm sem_perm ;
|
|
|
40 |
unsigned short sem_nsems ;
|
|
|
41 |
time_t sem_otime ;
|
|
|
42 |
time_t sem_ctime ;
|
|
|
43 |
} ;
|
|
|
44 |
|
|
|
45 |
+IF 0
|
|
|
46 |
+FIELD struct ~unnamed {
|
|
|
47 |
unsigned short semval ;
|
|
|
48 |
pid_t sempid ;
|
|
|
49 |
unsigned short semncnt ;
|
|
|
50 |
unsigned short semzcnt ;
|
|
|
51 |
} ;
|
|
|
52 |
+ENDIF
|
|
|
53 |
|
|
|
54 |
+FIELD struct sembuf {
|
|
|
55 |
unsigned short sem_num ;
|
|
|
56 |
short sem_op ;
|
|
|
57 |
short sem_flg ;
|
|
|
58 |
} ;
|
|
|
59 |
|
|
|
60 |
+FUNC int semget ( key_t, int, int ) ;
|
|
|
61 |
} ;
|
|
|
62 |
|
|
|
63 |
+FIELD union semun {
|
|
|
64 |
int val ;
|
|
|
65 |
struct semid_ds *buf ;
|
|
|
66 |
unsigned short *array ;
|
|
|
67 |
} ;
|
|
|
68 |
|
|
|
69 |
+IFNDEF ~building_libs
|
|
|
70 |
+FUNC int semctl ( int, int, int, union semun ) ;
|
|
|
71 |
+ELSE
|
|
|
72 |
+IFNDEF __semun_defined
|
|
|
73 |
+FUNC int __old_semctl | semctl.1 ( int, int, int, union semun ) ;
|
|
|
74 |
+ELSE
|
|
|
75 |
+FUNC int semctl.2 ( int, int, int, union semun ) ;
|
|
|
76 |
+ENDIF
|
|
|
77 |
+ENDIF
|
|
|
78 |
|
|
|
79 |
%%%
|
|
|
80 |
#ifndef __semun_defined
|
|
|
81 |
union semun {
|
|
|
82 |
int val ;
|
|
|
83 |
struct semid_ds *buf ;
|
|
|
84 |
unsigned short *array ;
|
|
|
85 |
} ;
|
|
|
86 |
|
|
|
87 |
#define __old_semctl( A, B, C, D ) semctl ( A, B, C, D )
|
|
|
88 |
#endif
|
|
|
89 |
%%%
|
|
|
90 |
|
|
|
91 |
+FUNC int semop ( int, struct sembuf *, unsigned ) ;
|