00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if __GNUC__ >= 3
00024 #pragma GCC system_header
00025 #endif
00026
00027
00028 #if defined __need_system_fcntl_h
00029
00030
00031 #include <sys/types.h>
00032
00033
00034
00035
00036
00037
00038 #if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
00039 # include <sys/stat.h>
00040 #endif
00041 #include_next <fcntl.h>
00042
00043 #else
00044
00045
00046 #ifndef _GL_FCNTL_H
00047
00048 #include <sys/types.h>
00049
00050
00051
00052
00053
00054
00055 #if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
00056 # include <sys/stat.h>
00057 #endif
00058
00059 #include_next <fcntl.h>
00060
00061 #ifndef _GL_FCNTL_H
00062 #define _GL_FCNTL_H
00063
00064 #ifndef __GLIBC__
00065 # include <unistd.h>
00066 #endif
00067
00068
00069
00070 #ifndef _GL_CXXDEFS_H
00071 #define _GL_CXXDEFS_H
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134 #if defined __cplusplus
00135 # define _GL_EXTERN_C extern "C"
00136 #else
00137 # define _GL_EXTERN_C extern
00138 #endif
00139
00140
00141
00142
00143
00144
00145
00146
00147 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
00148 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
00149 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
00150 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
00151
00152
00153
00154
00155
00156
00157
00158
00159 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
00160 _GL_EXTERN_C rettype func parameters_and_attributes
00161
00162
00163
00164
00165
00166
00167
00168 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
00169 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
00170 #if defined __cplusplus && defined GNULIB_NAMESPACE
00171 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
00172 namespace GNULIB_NAMESPACE \
00173 { \
00174 rettype (*const func) parameters = ::rpl_func; \
00175 } \
00176 _GL_EXTERN_C int _gl_cxxalias_dummy
00177 #else
00178 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
00179 _GL_EXTERN_C int _gl_cxxalias_dummy
00180 #endif
00181
00182
00183
00184
00185
00186
00187 #if defined __cplusplus && defined GNULIB_NAMESPACE
00188 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
00189 namespace GNULIB_NAMESPACE \
00190 { \
00191 rettype (*const func) parameters = \
00192 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
00193 } \
00194 _GL_EXTERN_C int _gl_cxxalias_dummy
00195 #else
00196 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
00197 _GL_EXTERN_C int _gl_cxxalias_dummy
00198 #endif
00199
00200
00201
00202
00203
00204
00205
00206
00207 #if defined __cplusplus && defined GNULIB_NAMESPACE
00208
00209
00210
00211
00212
00213
00214 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
00215 namespace GNULIB_NAMESPACE \
00216 { \
00217 static rettype (*func) parameters = ::func; \
00218 } \
00219 _GL_EXTERN_C int _gl_cxxalias_dummy
00220 #else
00221 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
00222 _GL_EXTERN_C int _gl_cxxalias_dummy
00223 #endif
00224
00225
00226
00227
00228
00229
00230 #if defined __cplusplus && defined GNULIB_NAMESPACE
00231 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
00232 namespace GNULIB_NAMESPACE \
00233 { \
00234 static rettype (*func) parameters = \
00235 reinterpret_cast<rettype(*)parameters>(::func); \
00236 } \
00237 _GL_EXTERN_C int _gl_cxxalias_dummy
00238 #else
00239 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
00240 _GL_EXTERN_C int _gl_cxxalias_dummy
00241 #endif
00242
00243
00244
00245
00246
00247
00248
00249 #if defined __cplusplus && defined GNULIB_NAMESPACE
00250
00251
00252
00253
00254
00255 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
00256 namespace GNULIB_NAMESPACE \
00257 { \
00258 static rettype (*func) parameters = \
00259 reinterpret_cast<rettype(*)parameters>( \
00260 (rettype2(*)parameters2)(::func)); \
00261 } \
00262 _GL_EXTERN_C int _gl_cxxalias_dummy
00263 #else
00264 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
00265 _GL_EXTERN_C int _gl_cxxalias_dummy
00266 #endif
00267
00268
00269
00270
00271
00272 #if defined __cplusplus && defined GNULIB_NAMESPACE
00273 # define _GL_CXXALIASWARN(func) \
00274 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
00275 # define _GL_CXXALIASWARN_1(func,namespace) \
00276 _GL_CXXALIASWARN_2 (func, namespace)
00277
00278
00279 # if !__OPTIMIZE__
00280 # define _GL_CXXALIASWARN_2(func,namespace) \
00281 _GL_WARN_ON_USE (func, \
00282 "The symbol ::" #func " refers to the system function. " \
00283 "Use " #namespace "::" #func " instead.")
00284 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00285 # define _GL_CXXALIASWARN_2(func,namespace) \
00286 extern __typeof__ (func) func
00287 # else
00288 # define _GL_CXXALIASWARN_2(func,namespace) \
00289 _GL_EXTERN_C int _gl_cxxalias_dummy
00290 # endif
00291 #else
00292 # define _GL_CXXALIASWARN(func) \
00293 _GL_EXTERN_C int _gl_cxxalias_dummy
00294 #endif
00295
00296
00297
00298
00299 #if defined __cplusplus && defined GNULIB_NAMESPACE
00300 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
00301 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
00302 GNULIB_NAMESPACE)
00303 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
00304 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
00305
00306
00307 # if !__OPTIMIZE__
00308 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00309 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
00310 "The symbol ::" #func " refers to the system function. " \
00311 "Use " #namespace "::" #func " instead.")
00312 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00313 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00314 extern __typeof__ (func) func
00315 # else
00316 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00317 _GL_EXTERN_C int _gl_cxxalias_dummy
00318 # endif
00319 #else
00320 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
00321 _GL_EXTERN_C int _gl_cxxalias_dummy
00322 #endif
00323
00324 #endif
00325
00326
00327
00328
00329
00330 #ifndef _GL_ARG_NONNULL
00331 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
00332 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
00333 # else
00334 # define _GL_ARG_NONNULL(params)
00335 # endif
00336 #endif
00337
00338
00339 #ifndef _GL_WARN_ON_USE
00340
00341 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
00342
00343 # define _GL_WARN_ON_USE(function, message) \
00344 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
00345 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00346
00347 # define _GL_WARN_ON_USE(function, message) \
00348 extern __typeof__ (function) function
00349 # else
00350 # define _GL_WARN_ON_USE(function, message) \
00351 _GL_WARN_EXTERN_C int _gl_warn_on_use
00352 # endif
00353 #endif
00354
00355
00356
00357
00358
00359
00360
00361 #ifndef _GL_WARN_ON_USE_CXX
00362 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
00363 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00364 extern rettype function parameters_and_attributes \
00365 __attribute__ ((__warning__ (msg)))
00366 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00367
00368 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00369 extern rettype function parameters_and_attributes
00370 # else
00371 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00372 _GL_WARN_EXTERN_C int _gl_warn_on_use
00373 # endif
00374 #endif
00375
00376
00377
00378 #ifndef _GL_WARN_EXTERN_C
00379 # if defined __cplusplus
00380 # define _GL_WARN_EXTERN_C extern "C"
00381 # else
00382 # define _GL_WARN_EXTERN_C extern
00383 # endif
00384 #endif
00385
00386
00387
00388
00389 #if 1
00390 # if 1
00391 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00392 # undef fcntl
00393 # define fcntl rpl_fcntl
00394 # endif
00395 _GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
00396 _GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
00397 # else
00398 # if !1
00399 _GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
00400 # endif
00401 _GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...));
00402 # endif
00403 _GL_CXXALIASWARN (fcntl);
00404 #elif defined GNULIB_POSIXCHECK
00405 # undef fcntl
00406 # if HAVE_RAW_DECL_FCNTL
00407 _GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
00408 "use gnulib module fcntl for portability");
00409 # endif
00410 #endif
00411
00412 #if 1
00413 # if 0
00414 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00415 # undef open
00416 # define open rpl_open
00417 # endif
00418 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
00419 _GL_ARG_NONNULL ((1)));
00420 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
00421 # else
00422 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
00423 # endif
00424
00425
00426 # if !defined __hpux
00427 _GL_CXXALIASWARN (open);
00428 # endif
00429 #elif defined GNULIB_POSIXCHECK
00430 # undef open
00431
00432 _GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
00433 "use gnulib module open for portability");
00434 #endif
00435
00436 #if 1
00437 # if 0
00438 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00439 # undef openat
00440 # define openat rpl_openat
00441 # endif
00442 _GL_FUNCDECL_RPL (openat, int,
00443 (int fd, char const *file, int flags, ...)
00444 _GL_ARG_NONNULL ((2)));
00445 _GL_CXXALIAS_RPL (openat, int,
00446 (int fd, char const *file, int flags, ...));
00447 # else
00448 # if !1
00449 _GL_FUNCDECL_SYS (openat, int,
00450 (int fd, char const *file, int flags, ...)
00451 _GL_ARG_NONNULL ((2)));
00452 # endif
00453 _GL_CXXALIAS_SYS (openat, int,
00454 (int fd, char const *file, int flags, ...));
00455 # endif
00456 _GL_CXXALIASWARN (openat);
00457 #elif defined GNULIB_POSIXCHECK
00458 # undef openat
00459 # if HAVE_RAW_DECL_OPENAT
00460 _GL_WARN_ON_USE (openat, "openat is not portable - "
00461 "use gnulib module openat for portability");
00462 # endif
00463 #endif
00464
00465
00466
00467
00468 #ifndef FD_CLOEXEC
00469 # define FD_CLOEXEC 1
00470 #endif
00471
00472
00473
00474
00475 #ifndef F_DUPFD_CLOEXEC
00476 # define F_DUPFD_CLOEXEC 0x40000000
00477
00478 # define GNULIB_defined_F_DUPFD_CLOEXEC 1
00479 #else
00480 # define GNULIB_defined_F_DUPFD_CLOEXEC 0
00481 #endif
00482
00483 #ifndef F_DUPFD
00484 # define F_DUPFD 1
00485 #endif
00486
00487 #ifndef F_GETFD
00488 # define F_GETFD 2
00489 #endif
00490
00491
00492
00493 #if !defined O_DIRECT && defined O_DIRECTIO
00494
00495 # define O_DIRECT O_DIRECTIO
00496 #endif
00497
00498 #if !defined O_CLOEXEC && defined O_NOINHERIT
00499
00500
00501 # define O_CLOEXEC O_NOINHERIT
00502 #endif
00503
00504 #ifndef O_CLOEXEC
00505 # define O_CLOEXEC 0
00506 #endif
00507
00508 #ifndef O_DIRECT
00509 # define O_DIRECT 0
00510 #endif
00511
00512 #ifndef O_DIRECTORY
00513 # define O_DIRECTORY 0
00514 #endif
00515
00516 #ifndef O_DSYNC
00517 # define O_DSYNC 0
00518 #endif
00519
00520 #ifndef O_EXEC
00521 # define O_EXEC O_RDONLY
00522 #endif
00523
00524 #ifndef O_NDELAY
00525 # define O_NDELAY 0
00526 #endif
00527
00528 #ifndef O_NOATIME
00529 # define O_NOATIME 0
00530 #endif
00531
00532 #ifndef O_NONBLOCK
00533 # define O_NONBLOCK O_NDELAY
00534 #endif
00535
00536 #ifndef O_NOCTTY
00537 # define O_NOCTTY 0
00538 #endif
00539
00540 #ifndef O_NOFOLLOW
00541 # define O_NOFOLLOW 0
00542 #endif
00543
00544 #ifndef O_NOLINKS
00545 # define O_NOLINKS 0
00546 #endif
00547
00548 #ifndef O_RSYNC
00549 # define O_RSYNC 0
00550 #endif
00551
00552 #ifndef O_SEARCH
00553 # define O_SEARCH O_RDONLY
00554 #endif
00555
00556 #ifndef O_SYNC
00557 # define O_SYNC 0
00558 #endif
00559
00560 #ifndef O_TTY_INIT
00561 # define O_TTY_INIT 0
00562 #endif
00563
00564
00565
00566 #if !defined O_BINARY && defined _O_BINARY
00567
00568 # define O_BINARY _O_BINARY
00569 # define O_TEXT _O_TEXT
00570 #endif
00571
00572 #if defined __BEOS__ || defined __HAIKU__
00573
00574 # undef O_BINARY
00575 # undef O_TEXT
00576 #endif
00577
00578 #ifndef O_BINARY
00579 # define O_BINARY 0
00580 # define O_TEXT 0
00581 #endif
00582
00583
00584
00585
00586
00587
00588
00589 #if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
00590 # undef AT_FDCWD
00591 #endif
00592
00593
00594
00595
00596 #ifndef AT_FDCWD
00597 # define AT_FDCWD (-3041965)
00598 #endif
00599
00600
00601
00602 #ifndef AT_SYMLINK_NOFOLLOW
00603 # define AT_SYMLINK_NOFOLLOW 4096
00604 #endif
00605
00606 #ifndef AT_REMOVEDIR
00607 # define AT_REMOVEDIR 1
00608 #endif
00609
00610
00611 #ifndef AT_SYMLINK_FOLLOW
00612 # define AT_SYMLINK_FOLLOW 2
00613 #endif
00614
00615 #ifndef AT_EACCESS
00616 # define AT_EACCESS 4
00617 #endif
00618
00619
00620 #endif
00621 #endif
00622 #endif