types.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #pragma once
  2. #include <bits/stdint.h>
  3. #include <stddef.h>
  4. #include <sys/cdefs.h>
  5. __BEGIN_DECLS
  6. typedef unsigned char u_char;
  7. typedef unsigned short u_short;
  8. typedef unsigned int u_int;
  9. typedef unsigned long u_long;
  10. typedef uint32_t uid_t;
  11. typedef uint32_t gid_t;
  12. typedef int __pid_t;
  13. #define pid_t __pid_t
  14. typedef int __ssize_t;
  15. #define ssize_t __ssize_t
  16. typedef __WINT_TYPE__ wint_t;
  17. typedef uint32_t ino_t;
  18. typedef int32_t off_t;
  19. typedef uint32_t dev_t;
  20. typedef uint16_t mode_t;
  21. typedef uint32_t nlink_t;
  22. typedef uint32_t blksize_t;
  23. typedef uint32_t blkcnt_t;
  24. typedef uint32_t time_t;
  25. typedef uint32_t useconds_t;
  26. typedef int32_t suseconds_t;
  27. typedef uint32_t clock_t;
  28. #define __socklen_t_defined
  29. #define __socklen_t uint32_t
  30. typedef __socklen_t socklen_t;
  31. struct stat {
  32. dev_t st_dev; /* ID of device containing file */
  33. ino_t st_ino; /* inode number */
  34. mode_t st_mode; /* protection */
  35. nlink_t st_nlink; /* number of hard links */
  36. uid_t st_uid; /* user ID of owner */
  37. gid_t st_gid; /* group ID of owner */
  38. dev_t st_rdev; /* device ID (if special file) */
  39. off_t st_size; /* total size, in bytes */
  40. blksize_t st_blksize; /* blocksize for file system I/O */
  41. blkcnt_t st_blocks; /* number of 512B blocks allocated */
  42. time_t st_atime; /* time of last access */
  43. time_t st_mtime; /* time of last modification */
  44. time_t st_ctime; /* time of last status change */
  45. };
  46. struct utimbuf {
  47. time_t actime;
  48. time_t modtime;
  49. };
  50. typedef int pthread_t;
  51. typedef int pthread_key_t;
  52. typedef void* pthread_once_t;
  53. typedef struct __pthread_mutex_t {
  54. uint32_t lock;
  55. pthread_t owner;
  56. int level;
  57. int type;
  58. } pthread_mutex_t;
  59. typedef void* pthread_attr_t;
  60. typedef struct __pthread_mutexattr_t {
  61. int type;
  62. } pthread_mutexattr_t;
  63. typedef struct __pthread_cond_t {
  64. int32_t value;
  65. uint32_t previous;
  66. int clockid; // clockid_t
  67. } pthread_cond_t;
  68. typedef void* pthread_rwlock_t;
  69. typedef void* pthread_rwlockatrr_t;
  70. typedef void* pthread_spinlock_t;
  71. typedef struct __pthread_condattr_t {
  72. int clockid; // clockid_t
  73. } pthread_condattr_t;
  74. __END_DECLS