fcntl.h 810 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_TRUNC 01000
  9. #define O_APPEND 02000
  10. #define O_DIRECTORY 0200000
  11. #define O_CLOEXEC 02000000
  12. #define F_DUPFD 0
  13. #define F_GETFD 1
  14. #define F_SETFD 2
  15. // TODO: more flags
  16. #define FD_CLOEXEC 1
  17. #define AT_FDCWD (-100)
  18. #define AT_SYMLINK_NOFOLLOW 0x100
  19. #define AT_REMOVEDIR 0x200
  20. #define AT_SYMLINK_FOLLOW 0x400
  21. #define AT_STATX_SYNC_AS_STAT 0x0000
  22. #define AT_STATX_SYNC_TYPE 0x6000
  23. #define AT_STATX_SYNC_FORCE 0x8000
  24. #define AT_STATX_DONT_SYNC 0x2000
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. int open(const char* filename, int flags, ...);
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32. #endif