Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.2 KiB

  1. /***
  2. *sys\stat.h - defines structure used by stat() and fstat()
  3. *
  4. * Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file defines the structure used by the stat() and fstat()
  8. * routines.
  9. * [System V]
  10. *
  11. ****/
  12. #ifndef _INC_STAT
  13. #ifndef _INC_TYPES
  14. #include <sys/types.h>
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #if (_MSC_VER <= 600)
  20. #define __cdecl _cdecl
  21. #define __far _far
  22. #endif
  23. #ifndef _TIME_T_DEFINED
  24. typedef long time_t;
  25. #define _TIME_T_DEFINED
  26. #endif
  27. /* define structure for returning status information */
  28. #ifndef _STAT_DEFINED
  29. #pragma pack(2)
  30. struct _stat {
  31. _dev_t st_dev;
  32. _ino_t st_ino;
  33. unsigned short st_mode;
  34. short st_nlink;
  35. short st_uid;
  36. short st_gid;
  37. _dev_t st_rdev;
  38. _off_t st_size;
  39. time_t st_atime;
  40. time_t st_mtime;
  41. time_t st_ctime;
  42. };
  43. #ifndef __STDC__
  44. /* Non-ANSI name for compatibility */
  45. struct stat {
  46. _dev_t st_dev;
  47. _ino_t st_ino;
  48. unsigned short st_mode;
  49. short st_nlink;
  50. short st_uid;
  51. short st_gid;
  52. _dev_t st_rdev;
  53. _off_t st_size;
  54. time_t st_atime;
  55. time_t st_mtime;
  56. time_t st_ctime;
  57. };
  58. #endif
  59. #pragma pack()
  60. #define _STAT_DEFINED
  61. #endif
  62. #define _S_IFMT 0170000 /* file type mask */
  63. #define _S_IFDIR 0040000 /* directory */
  64. #define _S_IFCHR 0020000 /* character special */
  65. #define _S_IFREG 0100000 /* regular */
  66. #define _S_IREAD 0000400 /* read permission, owner */
  67. #define _S_IWRITE 0000200 /* write permission, owner */
  68. #define _S_IEXEC 0000100 /* execute/search permission, owner */
  69. /* function prototypes */
  70. int __cdecl _fstat(int, struct _stat *);
  71. int __cdecl _stat(const char *, struct _stat *);
  72. #ifndef __STDC__
  73. /* Non-ANSI names for compatibility */
  74. #define S_IFMT _S_IFMT
  75. #define S_IFDIR _S_IFDIR
  76. #define S_IFCHR _S_IFCHR
  77. #define S_IFREG _S_IFREG
  78. #define S_IREAD _S_IREAD
  79. #define S_IWRITE _S_IWRITE
  80. #define S_IEXEC _S_IEXEC
  81. int __cdecl fstat(int, struct stat *);
  82. int __cdecl stat(const char *, struct stat *);
  83. #endif
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #define _INC_STAT
  88. #endif