fcntl.h 904 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef __GBLIBC_FCNTL_H_
  2. #define __GBLIBC_FCNTL_H_
  3. #include <stdint.h>
  4. #define O_RDONLY 00
  5. #define O_WRONLY 01
  6. #define O_RDWR 02
  7. #define O_CREAT 0100
  8. #define O_EXCL 0200
  9. #define O_TRUNC 01000
  10. #define O_APPEND 02000
  11. #define O_DIRECTORY 0200000
  12. #define O_CLOEXEC 02000000
  13. #define F_DUPFD 0
  14. #define F_GETFD 1
  15. #define F_SETFD 2
  16. #define F_GETFL 3
  17. #define F_SETFL 4
  18. #define F_DUPFD_CLOEXEC 1030
  19. // TODO: more flags
  20. #define FD_CLOEXEC 1
  21. #define AT_FDCWD (-100)
  22. #define AT_SYMLINK_NOFOLLOW 0x100
  23. #define AT_REMOVEDIR 0x200
  24. #define AT_SYMLINK_FOLLOW 0x400
  25. #define AT_STATX_SYNC_AS_STAT 0x0000
  26. #define AT_STATX_SYNC_TYPE 0x6000
  27. #define AT_STATX_SYNC_FORCE 0x8000
  28. #define AT_STATX_DONT_SYNC 0x2000
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. int open(const char* filename, int flags, ...);
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif