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 |
+SUBSET "u_proto" := {
|
|
|
29 |
+USE "posix", "sys/types.h" ;
|
|
|
30 |
+USE "posix", "sys/stat.h" ;
|
|
|
31 |
+IMPLEMENT "ansi", "stddef.h", "null" (!?) ;
|
|
|
32 |
+IMPLEMENT "ansi", "stdlib.h", "bottom" (!?) ;
|
|
|
33 |
+IMPLEMENT "ansi", "stdio.h", "rename" (!?) ;
|
|
|
34 |
+IMPLEMENT "ansi", "stdio.h", "seek_consts" (!?) ;
|
|
|
35 |
|
|
|
36 |
+IFNDEF _POSIX_VERSION
|
|
|
37 |
+DEFINE _POSIX_VERSION %% 198808L %% ;
|
|
|
38 |
+ENDIF
|
|
|
39 |
|
|
|
40 |
+CONST int R_OK, W_OK, X_OK, F_OK ;
|
|
|
41 |
|
|
|
42 |
+CONST int _POSIX_JOB_CONTROL, _POSIX_SAVED_IDS ;
|
|
|
43 |
|
|
|
44 |
+CONST int _SC_ARG_MAX, _SC_CHILD_MAX, _SC_CLK_TCK, _SC_JOB_CONTROL ;
|
|
|
45 |
+CONST int _SC_NGROUPS_MAX, _SC_OPEN_MAX, _SC_SAVED_IDS, _SC_VERSION ;
|
|
|
46 |
|
|
|
47 |
+CONST int _PC_CHOWN_RESTRICTED, _PC_LINK_MAX, _PC_MAX_CANON ;
|
|
|
48 |
+CONST int _PC_MAX_INPUT, _PC_NAME_MAX, _PC_NO_TRUNC, _PC_PATH_MAX ;
|
|
|
49 |
+CONST int _PC_PIPE_BUF, _PC_VDISABLE ;
|
|
|
50 |
|
|
|
51 |
+DEFINE STDIN_FILENO 0 ;
|
|
|
52 |
+DEFINE STDOUT_FILENO 1 ;
|
|
|
53 |
+DEFINE STDERR_FILENO 2 ;
|
|
|
54 |
|
|
|
55 |
+EXP (extern) char **environ ;
|
|
|
56 |
|
|
|
57 |
+FUNC ~bottom _exit ( int ) ;
|
|
|
58 |
+FUNC int access ( const char *, int ) ;
|
|
|
59 |
+FUNC unsigned int alarm ( unsigned int ) ;
|
|
|
60 |
+FUNC int chdir ( const char * ) ;
|
|
|
61 |
+FUNC int close ( int ) ;
|
|
|
62 |
+FUNC int dup ( int ) ;
|
|
|
63 |
+FUNC int dup2 ( int, int ) ;
|
|
|
64 |
+FUNC int execl ( const char *, const char *, ... ) ;
|
|
|
65 |
+FUNC int execle ( const char *, const char *, ... ) ;
|
|
|
66 |
+FUNC int execlp ( const char *, const char *, ... ) ;
|
|
|
67 |
+FUNC int execv ( const char *, char * const [] ) ;
|
|
|
68 |
+FUNC int execve ( const char *, char * const [], char * const [] ) ;
|
|
|
69 |
+FUNC int execvp ( const char *, char * const [] ) ;
|
|
|
70 |
+FUNC pid_t fork ( void ) ;
|
|
|
71 |
+FUNC long fpathconf ( int, int ) ;
|
|
|
72 |
+FUNC gid_t getegid ( void ) ;
|
|
|
73 |
+FUNC uid_t geteuid ( void ) ;
|
|
|
74 |
+FUNC gid_t getgid ( void ) ;
|
|
|
75 |
+FUNC int getgroups ( int, gid_t [] ) ;
|
|
|
76 |
+FUNC char *getlogin ( void ) ;
|
|
|
77 |
+FUNC pid_t getpgrp ( void ) ;
|
|
|
78 |
+FUNC pid_t getpid ( void ) ;
|
|
|
79 |
+FUNC pid_t getppid ( void ) ;
|
|
|
80 |
+FUNC uid_t getuid ( void ) ;
|
|
|
81 |
+FUNC int isatty ( int ) ;
|
|
|
82 |
+FUNC int link ( const char *, const char * ) ;
|
|
|
83 |
+FUNC off_t lseek ( int, off_t, int ) ;
|
|
|
84 |
+FUNC long pathconf ( const char *, int ) ;
|
|
|
85 |
+FUNC int pause ( void ) ;
|
|
|
86 |
+FUNC int pipe ( int [2] ) ;
|
|
|
87 |
+FUNC int rmdir ( const char * ) ;
|
|
|
88 |
+FUNC pid_t setsid ( void ) ;
|
|
|
89 |
+FUNC unsigned int sleep ( unsigned int ) ;
|
|
|
90 |
+FUNC long sysconf ( int ) ;
|
|
|
91 |
+FUNC char *ttyname ( int ) ;
|
|
|
92 |
+FUNC int unlink ( const char * ) ;
|
|
|
93 |
|
|
|
94 |
+FUNC int chown ( const char *, uid_t, gid_t ) ;
|
|
|
95 |
+FUNC int setgid ( gid_t ) ;
|
|
|
96 |
+FUNC int setpgid ( pid_t, pid_t ) ;
|
|
|
97 |
+FUNC int setuid ( uid_t ) ;
|
|
|
98 |
} ;
|
|
|
99 |
|
|
|
100 |
+SUBSET "tcpgrp" := {
|
|
|
101 |
+USE "posix", "sys/types.h" ;
|
|
|
102 |
+FUNC pid_t tcgetpgrp ( int ) ;
|
|
|
103 |
+FUNC int tcsetpgrp ( int, pid_t ) ;
|
|
|
104 |
} ;
|
|
|
105 |
|
|
|
106 |
+IF 0
|
|
|
107 |
+SUBSET "getopt" := {
|
|
|
108 |
+FUNC int getopt ( int, char * const [], const char * ) ;
|
|
|
109 |
+EXP (extern) char *optarg ;
|
|
|
110 |
+EXP (extern) int optind, opterr ;
|
|
|
111 |
} ;
|
|
|
112 |
+ENDIF
|
|
|
113 |
|
|
|
114 |
+SUBSET "u_old" := {
|
|
|
115 |
+IFNDEF ~building_libs
|
|
|
116 |
+FUNC char *getcwd ( char *, int ) ;
|
|
|
117 |
+FUNC int read ( int, char *, unsigned ) ;
|
|
|
118 |
+FUNC int write ( int, char *, unsigned ) ;
|
|
|
119 |
+ELSE
|
|
|
120 |
+FUNC char *__old_getcwd | getcwd.1 ( char *, int ) ;
|
|
|
121 |
+FUNC int __old_read | read.1 ( int, char *, unsigned ) ;
|
|
|
122 |
+FUNC int __old_write | write.1 ( int, char *, unsigned ) ;
|
|
|
123 |
%%%
|
|
|
124 |
#define __old_getcwd( A, B ) getcwd ( A, B )
|
|
|
125 |
#define __old_read( A, B, C ) read ( A, B, C )
|
|
|
126 |
#define __old_write( A, B, C ) write ( A, B, C )
|
|
|
127 |
%%%
|
|
|
128 |
+ENDIF
|
|
|
129 |
} ;
|