stat.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef _UAPI_LINUX_STAT_H
  2. #define _UAPI_LINUX_STAT_H
  3. #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
  4. #define S_IFMT 00170000
  5. #define S_IFSOCK 0140000
  6. #define S_IFLNK 0120000
  7. #define S_IFREG 0100000
  8. #define S_IFBLK 0060000
  9. #define S_IFDIR 0040000
  10. #define S_IFCHR 0020000
  11. #define S_IFIFO 0010000
  12. #define S_ISUID 0004000
  13. #define S_ISGID 0002000
  14. #define S_ISVTX 0001000
  15. #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
  16. #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
  17. #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
  18. #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
  19. #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
  20. #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
  21. #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
  22. #define S_IRWXU 00700
  23. #define S_IRUSR 00400
  24. #define S_IWUSR 00200
  25. #define S_IXUSR 00100
  26. #define S_IRWXG 00070
  27. #define S_IRGRP 00040
  28. #define S_IWGRP 00020
  29. #define S_IXGRP 00010
  30. #define S_IRWXO 00007
  31. #define S_IROTH 00004
  32. #define S_IWOTH 00002
  33. #define S_IXOTH 00001
  34. #endif
  35. #endif /* _UAPI_LINUX_STAT_H */