fcntl.h 589 B

123456789101112131415161718192021222324252627282930313233343536
  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_STATX_SYNC_TYPE 0x6000
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. int open(const char* filename, int flags, ...);
  23. #ifdef __cplusplus
  24. }
  25. #endif
  26. #endif