fcntl.h 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * @file fcntl.h
  3. * @author fslongjin ([email protected])
  4. * @brief
  5. * @version 0.1
  6. * @date 2022-04-26
  7. *
  8. * @copyright Copyright (c) 2022
  9. *
  10. */
  11. #pragma once
  12. #define O_RDONLY 00000000 // Open Read-only
  13. #define O_WRONLY 00000001 // Open Write-only
  14. #define O_RDWR 00000002 // Open read/write
  15. #define O_ACCMODE 00000003 // Mask for file access modes
  16. #define O_CREAT 00000100 // Create file if it does not exist
  17. #define O_EXCL 00000200 // Fail if file already exists
  18. #define O_NOCTTY 00000400 // Do not assign controlling terminal
  19. #define O_TRUNC 00001000 // 文件存在且是普通文件,并以O_RDWR或O_WRONLY打开,则它会被清空
  20. #define O_APPEND 00002000 // 文件指针会被移动到文件末尾
  21. #define O_NONBLOCK 00004000 // 非阻塞式IO模式
  22. #define O_EXEC 00010000 // 以仅执行的方式打开(非目录文件)
  23. #define O_SEARCH 00020000 // Open the directory for search only
  24. #define O_DIRECTORY 00040000 // 打开的必须是一个目录
  25. #define O_NOFOLLOW 00100000 // Do not follow symbolic links