UnixTypes.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. extern "C" {
  3. namespace Unix {
  4. #define SEEK_SET 0
  5. #define SEEK_CUR 1
  6. #define SEEK_END 2
  7. #define SIGINT 2
  8. #define SIGKILL 9
  9. #define SIGSEGV 11
  10. #define SIGTERM 15
  11. typedef dword dev_t;
  12. typedef dword ino_t;
  13. typedef dword mode_t;
  14. typedef dword nlink_t;
  15. typedef dword uid_t;
  16. typedef dword gid_t;
  17. #ifdef SERENITY
  18. // FIXME: Support 64-bit offsets!
  19. typedef signed_dword off_t;
  20. typedef unsigned int time_t;
  21. #else
  22. typedef signed_qword off_t;
  23. typedef ::time_t time_t;
  24. #endif
  25. typedef dword blksize_t;
  26. typedef dword blkcnt_t;
  27. typedef dword size_t;
  28. typedef signed_dword ssize_t;
  29. struct stat {
  30. dev_t st_dev; /* ID of device containing file */
  31. ino_t st_ino; /* inode number */
  32. mode_t st_mode; /* protection */
  33. nlink_t st_nlink; /* number of hard links */
  34. uid_t st_uid; /* user ID of owner */
  35. gid_t st_gid; /* group ID of owner */
  36. dev_t st_rdev; /* device ID (if special file) */
  37. off_t st_size; /* total size, in bytes */
  38. blksize_t st_blksize; /* blocksize for file system I/O */
  39. blkcnt_t st_blocks; /* number of 512B blocks allocated */
  40. time_t st_atime; /* time of last access */
  41. time_t st_mtime; /* time of last modification */
  42. time_t st_ctime; /* time of last status change */
  43. };
  44. }
  45. }