unistd.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef _SYS_UNISTD_H
  2. #define _SYS_UNISTD_H
  3. #include <rtthread.h>
  4. #ifdef RT_USING_DFS
  5. #define STDIN_FILENO 0 /* standard input file descriptor */
  6. #define STDOUT_FILENO 1 /* standard output file descriptor */
  7. #define STDERR_FILENO 2 /* standard error file descriptor */
  8. #include <dfs_posix.h>
  9. #else
  10. #define _FREAD 0x0001 /* read enabled */
  11. #define _FWRITE 0x0002 /* write enabled */
  12. #define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */
  13. #define _FMARK 0x0010 /* internal; mark during gc() */
  14. #define _FDEFER 0x0020 /* internal; defer for next gc pass */
  15. #define _FASYNC 0x0040 /* signal pgrp when data ready */
  16. #define _FSHLOCK 0x0080 /* BSD flock() shared lock present */
  17. #define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */
  18. #define _FCREAT 0x0200 /* open with file create */
  19. #define _FTRUNC 0x0400 /* open with truncation */
  20. #define _FEXCL 0x0800 /* error on open if file exists */
  21. #define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */
  22. #define _FSYNC 0x2000 /* do all writes synchronously */
  23. #define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */
  24. #define _FNDELAY _FNONBLOCK /* non blocking I/O (4.2 style) */
  25. #define _FNOCTTY 0x8000 /* don't assign a ctty on this open */
  26. #define O_RDONLY 0 /* +1 == FREAD */
  27. #define O_WRONLY 1 /* +1 == FWRITE */
  28. #define O_RDWR 2 /* +1 == FREAD|FWRITE */
  29. #define O_APPEND _FAPPEND
  30. #define O_CREAT _FCREAT
  31. #define O_TRUNC _FTRUNC
  32. #define O_EXCL _FEXCL
  33. #define O_SYNC _FSYNC
  34. #endif
  35. #endif /* _SYS_UNISTD_H */