stat.h
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:3k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. /* @(#)stat.h 2.19 90/01/24 SMI; from UCB 4.7 83/05/21 */
  2. /*
  3.  * NOTE: changes to this file should also be made to xpg2include/sys/stat.h
  4.  */
  5. #ifndef __sys_stat_h
  6. #define __sys_stat_h
  7. #include <sys/cdefs.h>
  8. #include <sys/types.h>
  9. struct stat {
  10. dev_t st_dev;
  11. ino_t st_ino;
  12. mode_t st_mode;
  13. short st_nlink;
  14. uid_t st_uid;
  15. gid_t st_gid;
  16. dev_t st_rdev;
  17. off_t st_size;
  18. time_t st_atime;
  19. int st_spare1;
  20. time_t st_mtime;
  21. int st_spare2;
  22. time_t st_ctime;
  23. int st_spare3;
  24. long st_blksize;
  25. long st_blocks;
  26. long st_spare4[2];
  27. };
  28. #define _IFMT 0170000 /* type of file */
  29. #define _IFDIR 0040000 /* directory */
  30. #define _IFCHR 0020000 /* character special */
  31. #define _IFBLK 0060000 /* block special */
  32. #define _IFREG 0100000 /* regular */
  33. #define _IFLNK 0120000 /* symbolic link */
  34. #define _IFSOCK 0140000 /* socket */
  35. #define _IFIFO 0010000 /* fifo */
  36. #define S_ISUID 0004000 /* set user id on execution */
  37. #define S_ISGID 0002000 /* set group id on execution */
  38. #ifndef _POSIX_SOURCE
  39. #define S_ISVTX 0001000 /* save swapped text even after use */
  40. #define S_IREAD 0000400 /* read permission, owner */
  41. #define S_IWRITE  0000200 /* write permission, owner */
  42. #define S_IEXEC 0000100 /* execute/search permission, owner */
  43. #define S_ENFMT  0002000 /* enforcement-mode locking */
  44. #define S_IFMT _IFMT
  45. #define S_IFDIR _IFDIR
  46. #define S_IFCHR _IFCHR
  47. #define S_IFBLK _IFBLK
  48. #define S_IFREG _IFREG
  49. #define S_IFLNK _IFLNK
  50. #define S_IFSOCK _IFSOCK
  51. #define S_IFIFO _IFIFO
  52. #endif !_POSIX_SOURCE
  53. #define S_IRWXU  0000700 /* rwx, owner */
  54. #define S_IRUSR 0000400 /* read permission, owner */
  55. #define S_IWUSR 0000200 /* write permission, owner */
  56. #define S_IXUSR 0000100 /* execute/search permission, owner */
  57. #define S_IRWXG 0000070 /* rwx, group */
  58. #define S_IRGRP 0000040 /* read permission, group */
  59. #define S_IWGRP 0000020 /* write permission, grougroup */
  60. #define S_IXGRP 0000010 /* execute/search permission, group */
  61. #define S_IRWXO 0000007 /* rwx, other */
  62. #define S_IROTH 0000004 /* read permission, other */
  63. #define S_IWOTH 0000002 /* write permission, other */
  64. #define S_IXOTH 0000001 /* execute/search permission, other */
  65. #define S_ISBLK(m) (((m)&_IFMT) == _IFBLK)
  66. #define S_ISCHR(m) (((m)&_IFMT) == _IFCHR)
  67. #define S_ISDIR(m) (((m)&_IFMT) == _IFDIR)
  68. #define S_ISFIFO(m) (((m)&_IFMT) == _IFIFO)
  69. #define S_ISREG(m) (((m)&_IFMT) == _IFREG)
  70. #ifndef _POSIX_SOURCE
  71. #define S_ISLNK(m) (((m)&_IFMT) == _IFLNK)
  72. #define S_ISSOCK(m) (((m)&_IFMT) == _IFSOCK)
  73. #endif
  74. __BEGIN_DECLS
  75. int chmod  __P_((const char *path, mode_t mode));
  76. int fstat  __P_((int fd, struct stat *sbuf));
  77. int mkdir  __P_((char *path, mode_t mode));
  78. int mkfifo  __P_((char *path, mode_t mode));
  79. int stat  __P_((const char *path, struct stat *sbuf));
  80. mode_t umask  __P_((mode_t mask));
  81. __END_DECLS
  82. #endif /* !__sys_stat_h */