types.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. typedef unsigned char u_char;
  5. typedef unsigned short u_short;
  6. typedef unsigned int u_int;
  7. typedef unsigned long u_long;
  8. typedef uint32_t uid_t;
  9. typedef uint32_t gid_t;
  10. typedef long long ssize_t;
  11. typedef int __pid_t;
  12. #define pid_t __pid_t
  13. typedef __SIZE_TYPE__ size_t;
  14. typedef char *caddr_t;
  15. typedef int id_t;
  16. typedef uint64_t ino_t;
  17. typedef int64_t off_t;
  18. typedef uint32_t blkcnt_t;
  19. typedef uint32_t blksize_t;
  20. typedef uint32_t dev_t;
  21. typedef uint16_t mode_t;
  22. typedef uint32_t nlink_t;
  23. typedef int64_t time_t;
  24. typedef uint32_t useconds_t;
  25. typedef int32_t suseconds_t;
  26. typedef uint32_t clock_t;
  27. typedef uint64_t fsblkcnt_t;
  28. typedef uint64_t fsfilcnt_t;
  29. #define __socklen_t_defined
  30. #define __socklen_t uint32_t
  31. typedef __socklen_t socklen_t;
  32. struct utimbuf
  33. {
  34. time_t actime;
  35. time_t modtime;
  36. };
  37. typedef int pthread_t;
  38. typedef int pthread_key_t;
  39. typedef uint32_t pthread_once_t;
  40. typedef struct __pthread_mutex_t
  41. {
  42. uint32_t lock;
  43. pthread_t owner;
  44. int level;
  45. int type;
  46. } pthread_mutex_t;
  47. typedef void *pthread_attr_t;
  48. typedef struct __pthread_mutexattr_t
  49. {
  50. int type;
  51. } pthread_mutexattr_t;
  52. typedef struct __pthread_cond_t
  53. {
  54. pthread_mutex_t *mutex;
  55. uint32_t value;
  56. int clockid; // clockid_t
  57. } pthread_cond_t;
  58. typedef uint64_t pthread_rwlock_t;
  59. typedef void *pthread_rwlockattr_t;
  60. typedef struct __pthread_spinlock_t
  61. {
  62. int m_lock;
  63. } pthread_spinlock_t;
  64. typedef struct __pthread_condattr_t
  65. {
  66. int clockid; // clockid_t
  67. } pthread_condattr_t;