annotate src/sysfile.h @ 304:c6de09ad3017 r21-0b50

Import from CVS: tag r21-0b50
author cvs
date Mon, 13 Aug 2007 10:41:12 +0200
parents e11d67e05968
children 8e84bee8ddd0
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
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
29 #ifdef HAVE_UNISTD_H
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
30 #include <unistd.h>
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
31 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
32
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
33 #ifndef INCLUDED_FCNTL
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
34 # define INCLUDED_FCNTL
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
35 # include <fcntl.h>
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
36 #endif /* INCLUDED_FCNTL */
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
37
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 /* Load sys/types.h if not already loaded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 In some systems loading it twice is suicidal. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 #ifndef makedev
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #include <sys/types.h> /* some typedefs are used in sys/file.h */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #include <sys/file.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 #include <sys/stat.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 #include <sys/param.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
47 #if defined (NeXT) || defined(__CYGWIN32__)
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
48 /* what is needed from here? Do others need it too?
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
49 O_BINARY is in here under cygwin. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 # include <sys/fcntl.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 #endif /* NeXT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 #ifdef WINDOWSNT
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
54 #include <io.h>
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 272
diff changeset
55 #include <direct.h>
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
56 #endif
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 16
diff changeset
57
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 #ifndef O_RDONLY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 #define O_RDONLY 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 #endif
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_WRONLY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 #define O_WRONLY 1
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_RDWR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 #define O_RDWR 2
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
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
70 /* file opening defaults */
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
71 #ifndef OPEN_BINARY
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
72 #ifdef O_BINARY
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
73 #define OPEN_BINARY O_BINARY
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
74 #else
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
75 #define OPEN_BINARY (0)
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
76 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
77 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
78
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
79 #ifndef OPEN_TEXT
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
80 #ifdef O_TEXT
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
81 #define OPEN_TEXT O_TEXT
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
82 #else
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
83 #define OPEN_TEXT (0)
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
84 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
85 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
86
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
87 #ifndef CREAT_MODE
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
88 #ifdef WINDOWSNT
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
89 #define CREAT_MODE (S_IREAD | S_IWRITE)
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
90 #else
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
91 #define CREAT_MODE (0666)
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
92 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
93 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
94
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
95 #ifndef READ_TEXT
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
96 #ifdef O_TEXT
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
97 #define READ_TEXT "rt"
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
98 #else
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
99 #define READ_TEXT "r"
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
100 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
101 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
102
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
103 #ifndef READ_BINARY
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
104 #ifdef O_BINARY
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
105 #define READ_BINARY "rb"
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
106 #else
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
107 #define READ_BINARY "r"
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
108 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
109 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
110
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
111 #ifndef WRITE_BINARY
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
112 #ifdef O_BINARY
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
113 #define WRITE_BINARY "wb"
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
114 #else
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
115 #define WRITE_BINARY "w"
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
116 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
117 #endif
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 209
diff changeset
118
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 /* if system does not have symbolic links, it does not have lstat.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 In that case, use ordinary stat instead. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 #ifndef S_IFLNK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 #define lstat stat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 #if !S_IRUSR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 # if S_IREAD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 # define S_IRUSR S_IREAD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 # define S_IRUSR 00400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 # endif
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 #if !S_IWUSR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 # if S_IWRITE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 # define S_IWUSR S_IWRITE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 # define S_IWUSR 00200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 #if !S_IXUSR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 # if S_IEXEC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 # define S_IXUSR S_IEXEC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 # define S_IXUSR 00100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 #ifdef STAT_MACROS_BROKEN
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 #undef S_ISBLK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 #undef S_ISCHR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 #undef S_ISDIR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 #undef S_ISFIFO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 #undef S_ISLNK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 #undef S_ISMPB
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 #undef S_ISMPC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 #undef S_ISNWK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 #undef S_ISREG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 #undef S_ISSOCK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 #endif /* STAT_MACROS_BROKEN. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 #if !defined(S_ISBLK) && defined(S_IFBLK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 #if !defined(S_ISCHR) && defined(S_IFCHR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
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(S_ISDIR) && defined(S_IFDIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 #if !defined(S_ISREG) && defined(S_IFREG)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 #if !defined(S_ISFIFO) && defined(S_IFIFO)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 #if !defined(S_ISLNK) && defined(S_IFLNK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
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
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 100
diff changeset
192 #if !defined (USG) && !defined (WINDOWSNT)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 # define HAVE_FSYNC
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 #ifndef MAXPATHLEN
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 /* in 4.1, param.h fails to define this. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 #define MAXPATHLEN 1024
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 #endif /* not MAXPATHLEN */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 #ifndef X_OK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 # define X_OK 01
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 #ifndef FD_CLOEXEC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 # define FD_CLOEXEC 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
209 /* Emacs needs to use its own definitions of certain system calls on
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
210 some systems (like SunOS 4.1 and USG systems, where the read system
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
211 call is interruptible but Emacs expects it not to be; and under
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
212 MULE, where all filenames need to be converted to external format).
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
213 To do this, we #define read to be sys_read, which is defined in
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
214 sysdep.c. We first #undef read, in case some system file defines
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
215 read as a macro. sysdep.c doesn't encapsulate read, so the call to
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
216 read inside of sys_read will do the right thing.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
217
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
218 DONT_ENCAPSULATE is used in files such as sysdep.c that want to
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
219 call the actual system calls rather than the encapsulated versions.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
220 Those files can call sys_read to get the (possibly) encapsulated
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
221 versions.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
222
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
223 IMPORTANT: the redefinition of the system call must occur *after* the
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
224 inclusion of any header files that declare or define the system call;
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
225 otherwise lots of unfriendly things can happen. This goes for all
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
226 encapsulated system calls.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
227
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
228 We encapsulate the most common system calls here; we assume their
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
229 declarations are in one of the standard header files included above.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
230 Other encapsulations are declared in the appropriate sys*.h file. */
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
231
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
232 #ifdef ENCAPSULATE_READ
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
233 int sys_read (int, void *, size_t);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
234 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
235 #if defined (ENCAPSULATE_READ) && !defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
236 # undef read
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
237 # define read sys_read
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
238 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
239 #if !defined (ENCAPSULATE_READ) && defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
240 # define sys_read read
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
241 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
242
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
243 #ifdef ENCAPSULATE_WRITE
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
244 int sys_write (int, CONST void *, size_t);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
245 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
246 #if defined (ENCAPSULATE_WRITE) && !defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
247 # undef write
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
248 # define write sys_write
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
249 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
250 #if !defined (ENCAPSULATE_WRITE) && defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
251 # define sys_write write
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
252 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
253
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
254 #ifdef ENCAPSULATE_OPEN
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
255 int sys_open (CONST char *, int, ...);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
256 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
257 #if defined (ENCAPSULATE_OPEN) && !defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
258 # undef open
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
259 # define open sys_open
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
260 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
261 #if !defined (ENCAPSULATE_OPEN) && defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
262 # define sys_open open
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
263 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
264
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
265 #ifdef ENCAPSULATE_CLOSE
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
266 int sys_close (int);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
267 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
268 #if defined (ENCAPSULATE_CLOSE) && !defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
269 # undef close
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
270 # define close sys_close
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
271 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
272 #if !defined (ENCAPSULATE_CLOSE) && defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
273 # define sys_close close
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
274 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
275
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
276 /* Now the stdio versions ... */
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
277
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
278 #ifdef ENCAPSULATE_FREAD
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
279 size_t sys_fread (void *, size_t, size_t, FILE *);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
280 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
281 #if defined (ENCAPSULATE_FREAD) && !defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
282 # undef fread
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
283 # define fread sys_fread
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
284 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
285 #if !defined (ENCAPSULATE_FREAD) && defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
286 # define sys_fread fread
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
287 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
288
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
289 #ifdef ENCAPSULATE_FWRITE
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
290 size_t sys_fwrite (CONST void *, size_t, size_t, FILE *);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
291 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
292 #if defined (ENCAPSULATE_FWRITE) && !defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
293 # undef fwrite
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
294 # define fwrite sys_fwrite
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
295 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
296 #if !defined (ENCAPSULATE_FWRITE) && defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
297 # define sys_fwrite fwrite
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
298 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
299
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
300 #ifdef ENCAPSULATE_FOPEN
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
301 FILE *sys_fopen (CONST char *, CONST char *);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
302 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
303 #if defined (ENCAPSULATE_FOPEN) && !defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
304 # undef fopen
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
305 # define fopen sys_fopen
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
306 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
307 #if !defined (ENCAPSULATE_FOPEN) && defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
308 # define sys_fopen fopen
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
309 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
310
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
311 #ifdef ENCAPSULATE_FCLOSE
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
312 int sys_fclose (FILE *);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
313 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
314 #if defined (ENCAPSULATE_FCLOSE) && !defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
315 # undef fclose
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
316 # define fclose sys_fclose
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
317 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
318 #if !defined (ENCAPSULATE_FCLOSE) && defined (DONT_ENCAPSULATE)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
319 # define sys_fclose fclose
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
320 #endif
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
321
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
322
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 /* encapsulations: file-information calls */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 #ifdef ENCAPSULATE_ACCESS
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
326 int sys_access (CONST char *path, int mode);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 #if defined (ENCAPSULATE_ACCESS) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 # undef access
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 # define access sys_access
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 #if !defined (ENCAPSULATE_ACCESS) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 # define sys_access access
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
336 #ifdef ENCAPSULATE_EACCESS
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
337 int sys_eaccess (CONST char *path, int mode);
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
338 #endif
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
339 #if defined (ENCAPSULATE_EACCESS) && !defined (DONT_ENCAPSULATE)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
340 # undef eaccess
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
341 # define eaccess sys_eaccess
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
342 #endif
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
343 #if !defined (ENCAPSULATE_EACCESS) && defined (DONT_ENCAPSULATE)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
344 # define sys_eaccess eaccess
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
345 #endif
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
346
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 #ifdef ENCAPSULATE_LSTAT
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
348 int sys_lstat (CONST char *path, struct stat *buf);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 #if defined (ENCAPSULATE_LSTAT) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 # undef lstat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 # define lstat sys_lstat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 #if !defined (ENCAPSULATE_LSTAT) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 # define sys_lstat lstat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 #ifdef ENCAPSULATE_READLINK
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
359 int sys_readlink (CONST char *path, char *buf, size_t bufsiz);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 #if defined (ENCAPSULATE_READLINK) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 # undef readlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 # define readlink sys_readlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 #if !defined (ENCAPSULATE_READLINK) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 # define sys_readlink readlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 #ifdef ENCAPSULATE_STAT
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
370 int sys_stat (CONST char *path, struct stat *buf);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 #if defined (ENCAPSULATE_STAT) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 # undef stat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 /* Need to use arguments to avoid messing with struct stat */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 # define stat(path, buf) sys_stat (path, buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 #if !defined (ENCAPSULATE_STAT) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 # define sys_stat stat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 /* encapsulations: file-manipulation calls */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 #ifdef ENCAPSULATE_CHMOD
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
384 int sys_chmod (CONST char *path, mode_t mode);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 #if defined (ENCAPSULATE_CHMOD) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 # undef chmod
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 # define chmod sys_chmod
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 #if !defined (ENCAPSULATE_CHMOD) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 # define sys_chmod chmod
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 #ifdef ENCAPSULATE_CREAT
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
395 int sys_creat (CONST char *path, mode_t mode);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 #if defined (ENCAPSULATE_CREAT) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 # undef creat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 # define creat sys_creat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 #if !defined (ENCAPSULATE_CREAT) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 # define sys_creat creat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 #ifdef ENCAPSULATE_LINK
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
406 int sys_link (CONST char *existing, CONST char *new);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 #if defined (ENCAPSULATE_LINK) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 # undef link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 # define link sys_link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 #if !defined (ENCAPSULATE_LINK) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 # define sys_link link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 #ifdef ENCAPSULATE_RENAME
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
417 int sys_rename (CONST char *old, CONST char *new);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 #if defined (ENCAPSULATE_RENAME) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 # undef rename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 # define rename sys_rename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 #if !defined (ENCAPSULATE_RENAME) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 # define sys_rename rename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 #ifdef ENCAPSULATE_SYMLINK
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
428 int sys_symlink (CONST char *name1, CONST char *name2);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 #if defined (ENCAPSULATE_SYMLINK) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 # undef symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 # define symlink sys_symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 #if !defined (ENCAPSULATE_SYMLINK) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 # define sys_symlink symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 #ifdef ENCAPSULATE_UNLINK
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
439 int sys_unlink (CONST char *path);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 #if defined (ENCAPSULATE_UNLINK) && !defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 # undef unlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 # define unlink sys_unlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 #if !defined (ENCAPSULATE_UNLINK) && defined (DONT_ENCAPSULATE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 # define sys_unlink unlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 #endif
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
448
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
449 #ifdef ENCAPSULATE_EXECVP
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 251
diff changeset
450 int sys_execvp (CONST char *, char * CONST *);
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
451 #endif
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
452 #if defined (ENCAPSULATE_EXECVP) && !defined (DONT_ENCAPSULATE)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
453 # undef execvp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
454 # define execvp sys_execvp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
455 #endif
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
456 #if !defined (ENCAPSULATE_EXECVP) && defined (DONT_ENCAPSULATE)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
457 # define sys_execvp execvp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
458 #endif