annotate src/sysfile.h @ 569:9cdcb214753f

[xemacs-hg @ 2001-05-24 12:20:33 by yoshiki] Fix broken build. * gui.c (gui_error_2): New function. * lisp.h (gui_error_2): Declare it.
author yoshiki
date Thu, 24 May 2001 12:20:35 +0000
parents ed498ef2108b
children 6cca1c9bdc85
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1995 Free Software Foundation, Inc.
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
3 Copyright (C) 2001 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 /* Synched up with: Not really in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
24 #ifndef INCLUDED_sysfile_h_
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
25 #define INCLUDED_sysfile_h_
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
26
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 #include <errno.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
29 #ifndef WIN32_NATIVE
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
30 # include <sys/errno.h> /* <errno.h> does not always imply this */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 #ifdef HAVE_UNISTD_H
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
34 # include <unistd.h>
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 #ifndef INCLUDED_FCNTL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 # define INCLUDED_FCNTL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 # include <fcntl.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 #endif /* INCLUDED_FCNTL */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
42 /* The anonymous voice of the past says:
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 In some systems loading it twice is suicidal. */
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
44 #ifndef INCLUDED_SYS_TYPES
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
45 # define INCLUDED_SYS_TYPES
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
46 # include <sys/types.h> /* some typedefs are used in sys/file.h */
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
47 #endif /* INCLUDED_SYS_TYPES */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
48
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
49 #ifndef WIN32_NATIVE
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
50 # include <sys/file.h>
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
51 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
52
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 #include <sys/stat.h>
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
54
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
55 #if defined (WIN32_NATIVE) || defined (CYGWIN)
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
56 # include <io.h>
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
57 #endif
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
58
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
59 #ifdef WIN32_NATIVE
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
60 # include <direct.h>
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
61 #else
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
62 /* Some configuration files' definitions for the LOAD_AVE_CVT macro
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
63 (like sparc.h's) use macros like FSCALE, defined here. */
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
64 # ifdef HAVE_GTK
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 448
diff changeset
65 /* I hate GTK */
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
66 # undef MIN
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
67 # undef MAX
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
68 # endif /* HAVE_GTK */
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
69 # include <sys/param.h>
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
70 /* We used to conditionalize this on defined (NeXT) || defined (CYGWIN),
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
71 with the comment "what is needed from here? Do others need it too?
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
72 O_BINARY is in here under cygwin." sunplay.c needed this, so let's
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
73 just include it always and fix any breakage (unlikely) that happens. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 # include <sys/fcntl.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 #ifndef STDERR_FILENO
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 #define STDIN_FILENO 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 #define STDOUT_FILENO 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 #define STDERR_FILENO 2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 #ifndef O_RDONLY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 #define O_RDONLY 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 #ifndef O_WRONLY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 #define O_WRONLY 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 #ifndef O_RDWR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 #define O_RDWR 2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 /* file opening defaults */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 #ifndef OPEN_BINARY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 #ifdef O_BINARY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 #define OPEN_BINARY O_BINARY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 #define OPEN_BINARY (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 #ifndef OPEN_TEXT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 #ifdef O_TEXT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 #define OPEN_TEXT O_TEXT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 #define OPEN_TEXT (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 #ifndef CREAT_MODE
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
113 #ifdef WIN32_NATIVE
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 #define CREAT_MODE (S_IREAD | S_IWRITE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 #define CREAT_MODE (0666)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 #ifndef READ_TEXT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 #ifdef O_TEXT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 #define READ_TEXT "rt"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 #define READ_TEXT "r"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 #ifndef READ_BINARY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 #ifdef O_BINARY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 #define READ_BINARY "rb"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 #define READ_BINARY "r"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
136 #ifndef READ_PLUS_TEXT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
137 #ifdef O_TEXT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
138 #define READ_PLUS_TEXT "r+t"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
139 #else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
140 #define READ_PLUS_TEXT "r+"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
141 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
142 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
143
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
144 #ifndef READ_PLUS_BINARY
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
145 #ifdef O_BINARY
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
146 #define READ_PLUS_BINARY "r+b"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
147 #else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
148 #define READ_PLUS_BINARY "r+"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
149 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
150 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
151
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
152 #ifndef WRITE_TEXT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
153 #ifdef O_TEXT
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
154 #define WRITE_TEXT "wt"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
155 #else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
156 #define WRITE_TEXT "w"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
157 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
158 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
159
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 #ifndef WRITE_BINARY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 #ifdef O_BINARY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 #define WRITE_BINARY "wb"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 #define WRITE_BINARY "w"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 #ifndef O_NONBLOCK
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 #ifdef O_NDELAY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 #define O_NONBLOCK O_NDELAY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 #define O_NONBLOCK 04000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 /* if system does not have symbolic links, it does not have lstat.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 In that case, use ordinary stat instead. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 #ifndef S_IFLNK
448
3078fd1074e8 Import from CVS: tag r21-2-39
cvs
parents: 442
diff changeset
180 #define lstat xemacs_stat
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 #if !S_IRUSR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 # if S_IREAD
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 # define S_IRUSR S_IREAD
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 # else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 # define S_IRUSR 00400
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 # endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 #if !S_IWUSR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 # if S_IWRITE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 # define S_IWUSR S_IWRITE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 # else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 # define S_IWUSR 00200
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 # endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 #if !S_IXUSR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 # if S_IEXEC
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 # define S_IXUSR S_IEXEC
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 # else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 # define S_IXUSR 00100
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 # endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 #ifdef STAT_MACROS_BROKEN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 #undef S_ISBLK
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 #undef S_ISCHR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 #undef S_ISDIR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 #undef S_ISFIFO
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 #undef S_ISLNK
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 #undef S_ISMPB
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 #undef S_ISMPC
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 #undef S_ISNWK
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 #undef S_ISREG
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 #undef S_ISSOCK
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 #endif /* STAT_MACROS_BROKEN. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 #if !defined(S_ISBLK) && defined(S_IFBLK)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 #if !defined(S_ISCHR) && defined(S_IFCHR)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 #if !defined(S_ISDIR) && defined(S_IFDIR)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 #if !defined(S_ISREG) && defined(S_IFREG)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 #if !defined(S_ISFIFO) && defined(S_IFIFO)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 #if !defined(S_ISLNK) && defined(S_IFLNK)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
249 /* Client .c files should simply use `PATH_MAX'. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
250 #ifndef PATH_MAX
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
251 # if defined (_MAX_PATH)
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
252 /* MS Win -- and preferable to _POSIX_PATH_MAX, which is also defined */
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
253 # define PATH_MAX _MAX_PATH
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 462
diff changeset
254 # elif defined (_POSIX_PATH_MAX)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
255 # define PATH_MAX _POSIX_PATH_MAX
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
256 # elif defined (MAXPATHLEN)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
257 # define PATH_MAX MAXPATHLEN
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
258 # else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
259 # define PATH_MAX 1024
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
260 # endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
261 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
262
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
263 /* MAXPATHLEN is deprecated, but, as of this writing, still used. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 #ifndef MAXPATHLEN
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
265 # define MAXPATHLEN 1024
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
266 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
267
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
268 /* The following definitions are needed under Windows, at least */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
269 #ifndef X_OK
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
270 # define X_OK 1
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
271 #endif
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
273 #ifndef R_OK
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
274 # define R_OK 4
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
275 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
276
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
277 #ifndef W_OK
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
278 # define W_OK 2
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
279 #endif
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
280
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
281 #ifndef F_OK
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
282 # define F_OK 0
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 #ifndef FD_CLOEXEC
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 # define FD_CLOEXEC 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 /* Emacs needs to use its own definitions of certain system calls on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 some systems (like SunOS 4.1 and USG systems, where the read system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 call is interruptible but Emacs expects it not to be; and under
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 MULE, where all filenames need to be converted to external format).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 To do this, we #define read to be sys_read, which is defined in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 sysdep.c. We first #undef read, in case some system file defines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 read as a macro. sysdep.c doesn't encapsulate read, so the call to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 read inside of sys_read will do the right thing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 DONT_ENCAPSULATE is used in files such as sysdep.c that want to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 call the actual system calls rather than the encapsulated versions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 Those files can call sys_read to get the (possibly) encapsulated
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 versions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 IMPORTANT: the redefinition of the system call must occur *after* the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 inclusion of any header files that declare or define the system call;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 otherwise lots of unfriendly things can happen. This goes for all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 encapsulated system calls.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 We encapsulate the most common system calls here; we assume their
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 declarations are in one of the standard header files included above.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 Other encapsulations are declared in the appropriate sys*.h file. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 #ifdef ENCAPSULATE_READ
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 ssize_t sys_read (int, void *, size_t);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 #if defined (ENCAPSULATE_READ) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 # undef read
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 # define read sys_read
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 #if !defined (ENCAPSULATE_READ) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 # define sys_read read
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 #ifdef ENCAPSULATE_WRITE
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
324 ssize_t sys_write (int, const void *, size_t);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 #if defined (ENCAPSULATE_WRITE) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 # undef write
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 # define write sys_write
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 #if !defined (ENCAPSULATE_WRITE) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 # define sys_write write
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 #ifdef ENCAPSULATE_OPEN
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
335 int sys_open (const char *, int, ...);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 #if defined (ENCAPSULATE_OPEN) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 # undef open
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 # define open sys_open
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 #if !defined (ENCAPSULATE_OPEN) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 # define sys_open open
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 #ifdef ENCAPSULATE_CLOSE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 int sys_close (int);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 #if defined (ENCAPSULATE_CLOSE) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 # undef close
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 # define close sys_close
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 #if !defined (ENCAPSULATE_CLOSE) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 # define sys_close close
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 /* Now the stdio versions ... */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 #ifdef ENCAPSULATE_FREAD
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 size_t sys_fread (void *, size_t, size_t, FILE *);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 #if defined (ENCAPSULATE_FREAD) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 # undef fread
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 # define fread sys_fread
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 #if !defined (ENCAPSULATE_FREAD) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 # define sys_fread fread
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 #ifdef ENCAPSULATE_FWRITE
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
370 size_t sys_fwrite (const void *, size_t, size_t, FILE *);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 #if defined (ENCAPSULATE_FWRITE) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 # undef fwrite
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 # define fwrite sys_fwrite
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 #if !defined (ENCAPSULATE_FWRITE) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 # define sys_fwrite fwrite
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 #ifdef ENCAPSULATE_FOPEN
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
381 FILE *sys_fopen (const char *, const char *);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 #if defined (ENCAPSULATE_FOPEN) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 # undef fopen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 # define fopen sys_fopen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 #if !defined (ENCAPSULATE_FOPEN) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 # define sys_fopen fopen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 #ifdef ENCAPSULATE_FCLOSE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 int sys_fclose (FILE *);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 #if defined (ENCAPSULATE_FCLOSE) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 # undef fclose
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 # define fclose sys_fclose
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 #if !defined (ENCAPSULATE_FCLOSE) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 # define sys_fclose fclose
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 /* encapsulations: file-information calls */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 #ifdef ENCAPSULATE_ACCESS
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
406 int sys_access (const char *path, int mode);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 #if defined (ENCAPSULATE_ACCESS) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409 # undef access
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410 # define access sys_access
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 #if !defined (ENCAPSULATE_ACCESS) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 # define sys_access access
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416 #ifdef ENCAPSULATE_EACCESS
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
417 int sys_eaccess (const char *path, int mode);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 #if defined (ENCAPSULATE_EACCESS) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 # undef eaccess
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 # define eaccess sys_eaccess
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 #if !defined (ENCAPSULATE_EACCESS) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424 # define sys_eaccess eaccess
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 #ifdef ENCAPSULATE_LSTAT
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
428 int sys_lstat (const char *path, struct stat *buf);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 #if defined (ENCAPSULATE_LSTAT) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 # undef lstat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 # define lstat sys_lstat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 #if !defined (ENCAPSULATE_LSTAT) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 # define sys_lstat lstat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 #ifdef ENCAPSULATE_READLINK
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
439 int sys_readlink (const char *path, char *buf, size_t bufsiz);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 #if defined (ENCAPSULATE_READLINK) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 # undef readlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 # define readlink sys_readlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 #if !defined (ENCAPSULATE_READLINK) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 # define sys_readlink readlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448
432
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
449 #ifdef ENCAPSULATE_FSTAT
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
450 int sys_fstat (int fd, struct stat *buf);
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
451 #endif
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
452 #if defined (ENCAPSULATE_FSTAT) && !defined (DONT_ENCAPSULATE)
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
453 # undef fstat
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
454 # define fstat sys_fstat
432
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
455 #endif
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
456 #if !defined (ENCAPSULATE_FSTAT) && defined (DONT_ENCAPSULATE)
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
457 # define sys_fstat fstat
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
458 #endif
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
459
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
460 int xemacs_stat (const char *path, struct stat *buf);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462 /* encapsulations: file-manipulation calls */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 #ifdef ENCAPSULATE_CHMOD
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
465 int sys_chmod (const char *path, mode_t mode);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 #if defined (ENCAPSULATE_CHMOD) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 # undef chmod
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 # define chmod sys_chmod
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 #if !defined (ENCAPSULATE_CHMOD) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 # define sys_chmod chmod
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475 #ifdef ENCAPSULATE_CREAT
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
476 int sys_creat (const char *path, mode_t mode);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 #if defined (ENCAPSULATE_CREAT) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 # undef creat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 # define creat sys_creat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 #if !defined (ENCAPSULATE_CREAT) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 # define sys_creat creat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 #ifdef ENCAPSULATE_LINK
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
487 int sys_link (const char *existing, const char *new);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 #if defined (ENCAPSULATE_LINK) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 # undef link
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 # define link sys_link
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 #if !defined (ENCAPSULATE_LINK) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 # define sys_link link
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 #ifdef ENCAPSULATE_RENAME
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
498 int sys_rename (const char *old, const char *new);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 #if defined (ENCAPSULATE_RENAME) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 # undef rename
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 # define rename sys_rename
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 #if !defined (ENCAPSULATE_RENAME) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 # define sys_rename rename
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 #ifdef ENCAPSULATE_SYMLINK
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
509 int sys_symlink (const char *name1, const char *name2);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 #if defined (ENCAPSULATE_SYMLINK) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 # undef symlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 # define symlink sys_symlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 #if !defined (ENCAPSULATE_SYMLINK) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 # define sys_symlink symlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 #ifdef ENCAPSULATE_UNLINK
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
520 int sys_unlink (const char *path);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 #if defined (ENCAPSULATE_UNLINK) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 # undef unlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 # define unlink sys_unlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526 #if !defined (ENCAPSULATE_UNLINK) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 # define sys_unlink unlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 #ifdef ENCAPSULATE_EXECVP
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
531 int sys_execvp (const char *, char * const *);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 #if defined (ENCAPSULATE_EXECVP) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 # undef execvp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 # define execvp sys_execvp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 #if !defined (ENCAPSULATE_EXECVP) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 # define sys_execvp execvp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 #endif
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
540
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
541 #endif /* INCLUDED_sysfile_h_ */