123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- #ifndef _FCNTL_H
- #define _FCNTL_H 1
- #include <features.h>
- __BEGIN_DECLS
- #include <bits/fcntl.h>
- #ifdef __USE_XOPEN
- # include <sys/stat.h>
- #endif
- #ifdef __USE_MISC
- # ifndef R_OK
- # define R_OK 4
- # define W_OK 2
- # define X_OK 1
- # define F_OK 0
- # endif
- #endif
- #ifdef __USE_XOPEN
- # define SEEK_SET 0
- # define SEEK_CUR 1
- # define SEEK_END 2
- #endif
- #ifdef __USE_ATFILE
- # define AT_FDCWD -100
- # define AT_SYMLINK_NOFOLLOW 0x100
- # define AT_REMOVEDIR 0x200
- # define AT_SYMLINK_FOLLOW 0x400
- # define AT_EACCESS 0x200
- #endif
- #ifndef __USE_FILE_OFFSET64
- extern int fcntl (int __fd, int __cmd, ...);
- libc_hidden_proto(fcntl)
- #else
- # ifdef __REDIRECT
- extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
- # else
- # define fcntl fcntl64
- # endif
- #endif
- #ifdef __USE_LARGEFILE64
- extern int fcntl64 (int __fd, int __cmd, ...);
- libc_hidden_proto(fcntl64)
- #endif
- #ifndef __USE_FILE_OFFSET64
- extern int open (__const char *__file, int __oflag, ...) __nonnull ((1));
- libc_hidden_proto(open)
- #else
- # ifdef __REDIRECT
- extern int __REDIRECT (open, (__const char *__file, int __oflag, ...), open64)
- __nonnull ((1));
- # else
- # define open open64
- # endif
- #endif
- #ifdef __USE_LARGEFILE64
- extern int open64 (__const char *__file, int __oflag, ...) __nonnull ((1));
- libc_hidden_proto(open64)
- #endif
- #ifdef __USE_ATFILE
- # ifndef __USE_FILE_OFFSET64
- extern int openat (int __fd, __const char *__file, int __oflag, ...)
- __nonnull ((2));
- libc_hidden_proto(openat)
- # else
- # ifdef __REDIRECT
- extern int __REDIRECT (openat, (int __fd, __const char *__file, int __oflag,
- ...), openat64) __nonnull ((2));
- # else
- # define openat openat64
- # endif
- # endif
- extern int openat64 (int __fd, __const char *__file, int __oflag, ...)
- __nonnull ((2));
- libc_hidden_proto(openat64)
- #endif
- #ifndef __USE_FILE_OFFSET64
- extern int creat (__const char *__file, __mode_t __mode) __nonnull ((1));
- #else
- # ifdef __REDIRECT
- extern int __REDIRECT (creat, (__const char *__file, __mode_t __mode),
- creat64) __nonnull ((1));
- # else
- # define creat creat64
- # endif
- #endif
- #ifdef __USE_LARGEFILE64
- extern int creat64 (__const char *__file, __mode_t __mode) __nonnull ((1));
- #endif
- #if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
- && !defined __USE_POSIX))
- # define F_ULOCK 0
- # define F_LOCK 1
- # define F_TLOCK 2
- # define F_TEST 3
- # ifndef __USE_FILE_OFFSET64
- extern int lockf (int __fd, int __cmd, __off_t __len);
- libc_hidden_proto(lockf)
- # else
- # ifdef __REDIRECT
- extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64);
- # else
- # define lockf lockf64
- # endif
- # endif
- # ifdef __USE_LARGEFILE64
- extern int lockf64 (int __fd, int __cmd, __off64_t __len);
- libc_hidden_proto(lockf64)
- # endif
- #endif
- #if defined __USE_XOPEN2K && defined __UCLIBC_HAS_ADVANCED_REALTIME__
- # ifndef __USE_FILE_OFFSET64
- extern int posix_fadvise (int __fd, __off_t __offset, __off_t __len,
- int __advise) __THROW;
- # else
- # ifdef __REDIRECT_NTH
- extern int __REDIRECT_NTH (posix_fadvise, (int __fd, __off64_t __offset,
- __off64_t __len, int __advise),
- posix_fadvise64);
- # else
- # define posix_fadvise posix_fadvise64
- # endif
- # endif
- # ifdef __USE_LARGEFILE64
- extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
- int __advise) __THROW;
- # endif
- #endif
- #if 0
- # ifndef __USE_FILE_OFFSET64
- extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len);
- # else
- # ifdef __REDIRECT
- extern int __REDIRECT (posix_fallocate, (int __fd, __off64_t __offset,
- __off64_t __len),
- posix_fallocate64);
- # else
- # define posix_fallocate posix_fallocate64
- # endif
- # endif
- # ifdef __USE_LARGEFILE64
- extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
- # endif
- #endif
- #ifdef __UCLIBC_HAS_THREADS_NATIVE__
- extern int __fcntl_nocancel (int fd, int cmd, ...);
- #endif
- __END_DECLS
- #endif
|