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 "posix", "sys/types.h" ;
|
|
|
29 |
+USE "posix", "sys/stat.h" ;
|
|
|
30 |
+USE "posix", "unistd.h", "u_proto" ;
|
|
|
31 |
|
|
|
32 |
+CONST int F_DUPFD, F_GETFD, F_SETFD, F_GETFL, F_SETFL, F_GETLK ;
|
|
|
33 |
+CONST int F_SETLK, F_SETLKW ;
|
|
|
34 |
+CONST int FD_CLOEXEC ;
|
|
|
35 |
+CONST int F_RDLCK, F_UNLCK, F_WRLCK ;
|
|
|
36 |
+CONST int O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC ;
|
|
|
37 |
+CONST int O_APPEND, O_NONBLOCK ;
|
|
|
38 |
+CONST int O_ACCMODE ;
|
|
|
39 |
+CONST int O_RDONLY, O_RDWR, O_WRONLY ;
|
|
|
40 |
|
|
|
41 |
/* This type is abstracted */
|
|
|
42 |
+IF %% __STRICT_POSIX %%
|
|
|
43 |
+TYPEDEF pid_t ~fcntl_pid_t ;
|
|
|
44 |
+ELSE
|
|
|
45 |
+TYPE ( int ) ~fcntl_pid_t.1 ;
|
|
|
46 |
+MACRO pid_t __fcntl_pid2pid ( ~fcntl_pid_t ) ;
|
|
|
47 |
+MACRO ~fcntl_pid_t __pid2fcntl_pid ( pid_t ) ;
|
|
|
48 |
+IFNDEF ~building_libs
|
|
|
49 |
%%
|
|
|
50 |
#pragma accept conversion __fcntl_pid2pid
|
|
|
51 |
#pragma accept conversion __pid2fcntl_pid
|
|
|
52 |
%%
|
|
|
53 |
%%%
|
|
|
54 |
#include <fcntl.h>
|
|
|
55 |
#define __fcntl_pid2pid( X ) ( pid_t ) ( X )
|
|
|
56 |
#define __pid2fcntl_pid( X ) ( __local_fcntl_pid_t ) ( X )
|
|
|
57 |
%%%
|
|
|
58 |
+ENDIF
|
|
|
59 |
+ENDIF
|
|
|
60 |
|
|
|
61 |
+FIELD struct flock {
|
|
|
62 |
short l_type ;
|
|
|
63 |
short l_whence ;
|
|
|
64 |
off_t l_start ;
|
|
|
65 |
off_t l_len ;
|
|
|
66 |
~fcntl_pid_t l_pid ;
|
|
|
67 |
} ;
|
|
|
68 |
|
|
|
69 |
+FUNC int open ( const char *, int, ... ) ;
|
|
|
70 |
+FUNC int fcntl ( int, int, ... ) ;
|
|
|
71 |
+FUNC int creat ( const char *, mode_t ) ;
|