types.h 1.6 KB

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