vmstat.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. Copyright (c) 1990-2000 Info-ZIP. All rights reserved.
  3. See the accompanying file LICENSE, version 2000-Apr-09 or later
  4. (the contents of which are also included in unzip.h) for terms of use.
  5. If, for some reason, all these files are missing, the Info-ZIP license
  6. also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
  7. */
  8. #ifndef __vmstat_h
  9. #define __vmstat_h
  10. /* stat.h definitions */
  11. #ifndef _INO_T_DEFINED
  12. typedef unsigned short ino_t; /* i-node number (not used on DOS) */
  13. #define _INO_T_DEFINED
  14. #endif
  15. #ifndef _DEV_T_DEFINED
  16. typedef short dev_t; /* device code */
  17. #define _DEV_T_DEFINED
  18. #endif
  19. #ifndef _OFF_T_DEFINED
  20. typedef long off_t; /* file offset value */
  21. #define _OFF_T_DEFINED
  22. #endif
  23. #ifndef _STAT_DEFINED
  24. struct stat {
  25. dev_t st_dev;
  26. ino_t st_ino;
  27. short st_mode;
  28. short st_nlink;
  29. int st_uid;
  30. int st_gid;
  31. off_t st_size;
  32. time_t st_atime;
  33. time_t st_mtime;
  34. time_t st_ctime;
  35. };
  36. #define _STAT_DEFINED
  37. #endif
  38. int stat(const char *path, struct stat *buf);
  39. int fstat(int fd, struct stat *buf);
  40. #define S_IFMT 0xFFFF
  41. #define _FLDATA(m) (*(fldata_t *) &m)
  42. #define S_ISDIR(m) (_FLDATA(m).__dsorgPDSdir)
  43. #define S_ISREG(m) (_FLDATA(m).__dsorgPO | \
  44. _FLDATA(m).__dsorgPDSmem | \
  45. _FLDATA(m).__dsorgPS)
  46. #define S_ISBLK(m) (_FLDATA(m).__recfmBlk)
  47. #define S_ISMEM(m) (_FLDATA(m).__dsorgMem)
  48. #endif /* __vmstat_h */