annotate src/sysfile.h @ 247:e70b3a057e12 r20-5b22

Import from CVS: tag r20-5b22
author cvs
date Mon, 13 Aug 2007 10:18:21 +0200
parents 41ff10fd062f
children 677f6a0ee643
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Synched up with: Not really in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 #include <errno.h>
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
24
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
25 #ifndef WINDOWSNT
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #include <sys/errno.h> /* <errno.h> does not always imply this */
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
27 #endif
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
28
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 /* Load sys/types.h if not already loaded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 In some systems loading it twice is suicidal. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #ifndef makedev
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #include <sys/types.h> /* some typedefs are used in sys/file.h */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 #include <sys/file.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #include <sys/stat.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #include <sys/param.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 #if NeXT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 /* what is needed from here? Do others need it too? */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 # include <sys/fcntl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #endif /* NeXT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #ifdef WINDOWSNT
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
44 #include <io.h>
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
45 #endif
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
46
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
47 #if 0
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
48 #ifdef WINDOWSNT
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 #include <windows.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 #include <stdlib.h> /* for proper declaration of environ */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 #include <fcntl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 #include "nt.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 #define _P_NOWAIT 1 /* from process.h */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 #endif
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
55 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 #ifdef MSDOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 #include <dos.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 #include "msdos.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 #endif /* MSDOS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 #ifndef O_RDONLY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 #define O_RDONLY 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 #ifndef O_WRONLY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 #define O_WRONLY 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 #ifndef O_RDWR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 #define O_RDWR 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 /* if system does not have symbolic links, it does not have lstat.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 In that case, use ordinary stat instead. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 #ifndef S_IFLNK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 #define lstat stat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 #if !S_IRUSR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 # if S_IREAD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 # define S_IRUSR S_IREAD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 # define S_IRUSR 00400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 #if !S_IWUSR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 # if S_IWRITE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 # define S_IWUSR S_IWRITE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 # define S_IWUSR 00200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 #if !S_IXUSR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 # if S_IEXEC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 # define S_IXUSR S_IEXEC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 # define S_IXUSR 00100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 #ifdef STAT_MACROS_BROKEN
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 #undef S_ISBLK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 #undef S_ISCHR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 #undef S_ISDIR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 #undef S_ISFIFO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 #undef S_ISLNK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 #undef S_ISMPB
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 #undef S_ISMPC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 #undef S_ISNWK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 #undef S_ISREG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 #undef S_ISSOCK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 #endif /* STAT_MACROS_BROKEN. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 #if !defined(S_ISBLK) && defined(S_IFBLK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 #if !defined(S_ISCHR) && defined(S_IFCHR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 #if !defined(S_ISDIR) && defined(S_IFDIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 #if !defined(S_ISREG) && defined(S_IFREG)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 #if !defined(S_ISFIFO) && defined(S_IFIFO)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 #if !defined(S_ISLNK) && defined(S_IFLNK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 100
diff changeset
147 #if !defined (USG) && !defined (WINDOWSNT)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 # define HAVE_FSYNC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 #ifndef MAXPATHLEN
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 /* in 4.1, param.h fails to define this. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 #define MAXPATHLEN 1024
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 #endif /* not MAXPATHLEN */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 #ifndef X_OK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 # define X_OK 01
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 #ifndef FD_CLOEXEC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 # define FD_CLOEXEC 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 /* encapsulations: file-information calls */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 #ifdef ENCAPSULATE_ACCESS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 extern int sys_access (CONST char *path, int mode);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 #if defined (ENCAPSULATE_ACCESS) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 # undef access
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 # define access sys_access
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 #if !defined (ENCAPSULATE_ACCESS) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 # define sys_access access
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
177 #ifdef ENCAPSULATE_EACCESS
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
178 extern int sys_eaccess (CONST char *path, int mode);
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
179 #endif
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
180 #if defined (ENCAPSULATE_EACCESS) && !defined (DONT_ENCAPSULATE)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
181 # undef eaccess
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
182 # define eaccess sys_eaccess
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
183 #endif
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
184 #if !defined (ENCAPSULATE_EACCESS) && defined (DONT_ENCAPSULATE)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
185 # define sys_eaccess eaccess
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
186 #endif
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
187
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 #ifdef ENCAPSULATE_LSTAT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 extern int sys_lstat (CONST char *path, struct stat *buf);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 #if defined (ENCAPSULATE_LSTAT) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 # undef lstat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 # define lstat sys_lstat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 #if !defined (ENCAPSULATE_LSTAT) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 # define sys_lstat lstat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 #ifdef ENCAPSULATE_READLINK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 extern int sys_readlink (CONST char *path, char *buf, int bufsiz);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 #if defined (ENCAPSULATE_READLINK) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 # undef readlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 # define readlink sys_readlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 #if !defined (ENCAPSULATE_READLINK) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 # define sys_readlink readlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 #ifdef ENCAPSULATE_STAT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 extern int sys_stat (CONST char *path, struct stat *buf);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 #if defined (ENCAPSULATE_STAT) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 # undef stat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 /* Need to use arguments to avoid messing with struct stat */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 # define stat(path, buf) sys_stat (path, buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 #if !defined (ENCAPSULATE_STAT) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 # define sys_stat stat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 /* encapsulations: file-manipulation calls */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 #ifdef ENCAPSULATE_CHMOD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 extern int sys_chmod (CONST char *path, int mode);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 #if defined (ENCAPSULATE_CHMOD) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 # undef chmod
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 # define chmod sys_chmod
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 #if !defined (ENCAPSULATE_CHMOD) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 # define sys_chmod chmod
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 #ifdef ENCAPSULATE_CREAT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 extern int sys_creat (CONST char *path, int mode);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 #if defined (ENCAPSULATE_CREAT) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 # undef creat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 # define creat sys_creat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 #if !defined (ENCAPSULATE_CREAT) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 # define sys_creat creat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 #ifdef ENCAPSULATE_LINK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 extern int sys_link (CONST char *existing, CONST char *new);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 #if defined (ENCAPSULATE_LINK) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 # undef link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 # define link sys_link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 #if !defined (ENCAPSULATE_LINK) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 # define sys_link link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 #ifdef ENCAPSULATE_RENAME
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 extern int sys_rename (CONST char *old, CONST char *new);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 #if defined (ENCAPSULATE_RENAME) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 # undef rename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 # define rename sys_rename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 #if !defined (ENCAPSULATE_RENAME) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 # define sys_rename rename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 #ifdef ENCAPSULATE_SYMLINK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 extern int sys_symlink (CONST char *name1, CONST char *name2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 #if defined (ENCAPSULATE_SYMLINK) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 # undef symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 # define symlink sys_symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 #if !defined (ENCAPSULATE_SYMLINK) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 # define sys_symlink symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 #ifdef ENCAPSULATE_UNLINK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 extern int sys_unlink (CONST char *path);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 #if defined (ENCAPSULATE_UNLINK) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 # undef unlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 # define unlink sys_unlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 #if !defined (ENCAPSULATE_UNLINK) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 # define sys_unlink unlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 #endif
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
289
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
290 #ifdef ENCAPSULATE_EXECVP
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
291 extern int sys_execvp (CONST char *, char * CONST *);
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
292 #endif
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
293 #if defined (ENCAPSULATE_EXECVP) && !defined (DONT_ENCAPSULATE)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
294 # undef execvp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
295 # define execvp sys_execvp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
296 #endif
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
297 #if !defined (ENCAPSULATE_EXECVP) && defined (DONT_ENCAPSULATE)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
298 # define sys_execvp execvp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
299 #endif