00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _GL_UNISTD_H
00019
00020
00021 #if @HAVE_UNISTD_H@
00022 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
00023 #endif
00024
00025 #ifndef _GL_UNISTD_H
00026 #define _GL_UNISTD_H
00027
00028
00029 #if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET)
00030 # include <stdio.h>
00031 #endif
00032
00033
00034 #include <stdlib.h>
00035
00036
00037
00038
00039
00040
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044
00045
00046 #if @GNULIB_CHOWN@
00047 # if @REPLACE_CHOWN@
00048 # ifndef REPLACE_CHOWN
00049 # define REPLACE_CHOWN 1
00050 # endif
00051 # if REPLACE_CHOWN
00052
00053
00054
00055
00056
00057 # define chown rpl_chown
00058 extern int chown (const char *file, uid_t uid, gid_t gid);
00059 # endif
00060 # endif
00061 #elif defined GNULIB_POSIXCHECK
00062 # undef chown
00063 # define chown(f,u,g) \
00064 (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \
00065 "doesn't treat a uid or gid of -1 on some systems - " \
00066 "use gnulib module chown for portability"), \
00067 chown (f, u, g))
00068 #endif
00069
00070
00071 #if @GNULIB_DUP2@
00072 # if !@HAVE_DUP2@
00073
00074
00075
00076
00077
00078 extern int dup2 (int oldfd, int newfd);
00079 # endif
00080 #elif defined GNULIB_POSIXCHECK
00081 # undef dup2
00082 # define dup2(o,n) \
00083 (GL_LINK_WARNING ("dup2 is unportable - " \
00084 "use gnulib module dup2 for portability"), \
00085 dup2 (o, n))
00086 #endif
00087
00088
00089 #if @GNULIB_ENVIRON@
00090 # if !@HAVE_DECL_ENVIRON@
00091
00092
00093 # if defined __APPLE__ && defined __MACH__
00094 # include <crt_externs.h>
00095 # define environ (*_NSGetEnviron ())
00096 # else
00097 extern char **environ;
00098 # endif
00099 # endif
00100 #elif defined GNULIB_POSIXCHECK
00101 # undef environ
00102 # define environ \
00103 (GL_LINK_WARNING ("environ is unportable - " \
00104 "use gnulib module environ for portability"), \
00105 environ)
00106 #endif
00107
00108
00109 #if @GNULIB_FCHDIR@
00110 # if @REPLACE_FCHDIR@
00111
00112
00113
00114
00115
00116
00117 extern int fchdir (int );
00118
00119 # define close rpl_close
00120 extern int close (int);
00121 # define dup rpl_dup
00122 extern int dup (int);
00123 # define dup2 rpl_dup2
00124 extern int dup2 (int, int);
00125
00126 # endif
00127 #elif defined GNULIB_POSIXCHECK
00128 # undef fchdir
00129 # define fchdir(f) \
00130 (GL_LINK_WARNING ("fchdir is unportable - " \
00131 "use gnulib module fchdir for portability"), \
00132 fchdir (f))
00133 #endif
00134
00135
00136 #if @GNULIB_FTRUNCATE@
00137 # if !@HAVE_FTRUNCATE@
00138
00139
00140
00141
00142 extern int ftruncate (int fd, off_t length);
00143 # endif
00144 #elif defined GNULIB_POSIXCHECK
00145 # undef ftruncate
00146 # define ftruncate(f,l) \
00147 (GL_LINK_WARNING ("ftruncate is unportable - " \
00148 "use gnulib module ftruncate for portability"), \
00149 ftruncate (f, l))
00150 #endif
00151
00152
00153 #if @GNULIB_GETCWD@
00154
00155
00156 # include <stdlib.h>
00157 # if @REPLACE_GETCWD@
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168 # define getcwd rpl_getcwd
00169 extern char * getcwd (char *buf, size_t size);
00170 # endif
00171 #elif defined GNULIB_POSIXCHECK
00172 # undef getcwd
00173 # define getcwd(b,s) \
00174 (GL_LINK_WARNING ("getcwd is unportable - " \
00175 "use gnulib module getcwd for portability"), \
00176 getcwd (b, s))
00177 #endif
00178
00179
00180 #if @GNULIB_GETLOGIN_R@
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190 # if !@HAVE_DECL_GETLOGIN_R@
00191 # include <stddef.h>
00192 extern int getlogin_r (char *name, size_t size);
00193 # endif
00194 #elif defined GNULIB_POSIXCHECK
00195 # undef getlogin_r
00196 # define getlogin_r(n,s) \
00197 (GL_LINK_WARNING ("getlogin_r is unportable - " \
00198 "use gnulib module getlogin_r for portability"), \
00199 getlogin_r (n, s))
00200 #endif
00201
00202
00203 #if @GNULIB_GETPAGESIZE@
00204 # if @REPLACE_GETPAGESIZE@
00205 # define getpagesize rpl_getpagesize
00206 extern int getpagesize (void);
00207 # elif !@HAVE_GETPAGESIZE@
00208
00209 # if !defined getpagesize && defined _SC_PAGESIZE
00210 # if ! (defined __VMS && __VMS_VER < 70000000)
00211 # define getpagesize() sysconf (_SC_PAGESIZE)
00212 # endif
00213 # endif
00214
00215 # if !defined getpagesize && defined __VMS
00216 # ifdef __ALPHA
00217 # define getpagesize() 8192
00218 # else
00219 # define getpagesize() 512
00220 # endif
00221 # endif
00222
00223 # if !defined getpagesize && @HAVE_OS_H@
00224 # include <OS.h>
00225 # if defined B_PAGE_SIZE
00226 # define getpagesize() B_PAGE_SIZE
00227 # endif
00228 # endif
00229
00230 # if !defined getpagesize && defined __amigaos4__
00231 # define getpagesize() 2048
00232 # endif
00233
00234 # if !defined getpagesize && @HAVE_SYS_PARAM_H@
00235 # include <sys/param.h>
00236 # ifdef EXEC_PAGESIZE
00237 # define getpagesize() EXEC_PAGESIZE
00238 # else
00239 # ifdef NBPG
00240 # ifndef CLSIZE
00241 # define CLSIZE 1
00242 # endif
00243 # define getpagesize() (NBPG * CLSIZE)
00244 # else
00245 # ifdef NBPC
00246 # define getpagesize() NBPC
00247 # endif
00248 # endif
00249 # endif
00250 # endif
00251 # endif
00252 #elif defined GNULIB_POSIXCHECK
00253 # undef getpagesize
00254 # define getpagesize() \
00255 (GL_LINK_WARNING ("getpagesize is unportable - " \
00256 "use gnulib module getpagesize for portability"), \
00257 getpagesize ())
00258 #endif
00259
00260
00261 #if @GNULIB_LCHOWN@
00262 # if @REPLACE_LCHOWN@
00263
00264
00265
00266
00267
00268 # define lchown rpl_lchown
00269 extern int lchown (char const *file, uid_t owner, gid_t group);
00270 # endif
00271 #elif defined GNULIB_POSIXCHECK
00272 # undef lchown
00273 # define lchown(f,u,g) \
00274 (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \
00275 "systems - use gnulib module lchown for portability"), \
00276 lchown (f, u, g))
00277 #endif
00278
00279
00280 #if @GNULIB_LSEEK@
00281 # if @REPLACE_LSEEK@
00282
00283
00284
00285
00286 # define lseek rpl_lseek
00287 extern off_t lseek (int fd, off_t offset, int whence);
00288 # endif
00289 #elif defined GNULIB_POSIXCHECK
00290 # undef lseek
00291 # define lseek(f,o,w) \
00292 (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \
00293 "systems - use gnulib module lseek for portability"), \
00294 lseek (f, o, w))
00295 #endif
00296
00297
00298 #if @GNULIB_READLINK@
00299
00300
00301
00302
00303
00304 # if !@HAVE_READLINK@
00305 # include <stddef.h>
00306 extern int readlink (const char *file, char *buf, size_t bufsize);
00307 # endif
00308 #elif defined GNULIB_POSIXCHECK
00309 # undef readlink
00310 # define readlink(f,b,s) \
00311 (GL_LINK_WARNING ("readlink is unportable - " \
00312 "use gnulib module readlink for portability"), \
00313 readlink (f, b, s))
00314 #endif
00315
00316
00317 #if @GNULIB_SLEEP@
00318
00319
00320
00321
00322 # if !@HAVE_SLEEP@
00323 extern unsigned int sleep (unsigned int n);
00324 # endif
00325 #elif defined GNULIB_POSIXCHECK
00326 # undef sleep
00327 # define sleep(n) \
00328 (GL_LINK_WARNING ("sleep is unportable - " \
00329 "use gnulib module sleep for portability"), \
00330 sleep (n))
00331 #endif
00332
00333
00334 #ifdef __cplusplus
00335 }
00336 #endif
00337
00338
00339 #endif
00340 #endif