fcntl.h 962 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #define SEEK_SET 0
  30. #define SEEK_CUR 1
  31. #define SEEK_END 2
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. int open(const char* filename, int flags, ...);
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif