types.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 uint64_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. typedef uint64_t sector_t;
  30. #define __socklen_t_defined
  31. #define __socklen_t uint32_t
  32. typedef __socklen_t socklen_t;
  33. #define pgoff_t unsigned long
  34. struct utimbuf
  35. {
  36. time_t actime;
  37. time_t modtime;
  38. };
  39. typedef int pthread_t;
  40. typedef int pthread_key_t;
  41. typedef uint32_t pthread_once_t;
  42. typedef struct __pthread_mutex_t
  43. {
  44. uint32_t lock;
  45. pthread_t owner;
  46. int level;
  47. int type;
  48. } pthread_mutex_t;
  49. typedef void *pthread_attr_t;
  50. typedef struct __pthread_mutexattr_t
  51. {
  52. int type;
  53. } pthread_mutexattr_t;
  54. typedef struct __pthread_cond_t
  55. {
  56. pthread_mutex_t *mutex;
  57. uint32_t value;
  58. int clockid; // clockid_t
  59. } pthread_cond_t;
  60. typedef uint64_t pthread_rwlock_t;
  61. typedef void *pthread_rwlockattr_t;
  62. typedef struct __pthread_spinlock_t
  63. {
  64. int m_lock;
  65. } pthread_spinlock_t;
  66. typedef struct __pthread_condattr_t
  67. {
  68. int clockid; // clockid_t
  69. } pthread_condattr_t;
  70. typedef uint64_t gfp_t;