structs.c 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #include <dirent.h>
  2. #include <fcntl.h>
  3. #include <glob.h>
  4. #include <grp.h>
  5. #include <locale.h>
  6. #include <pthread.h>
  7. #include <stdio.h>
  8. #include <termios.h>
  9. #include <netinet/in.h>
  10. #include <netdb.h>
  11. #include <poll.h>
  12. #include <pwd.h>
  13. #include <sys/shm.h>
  14. #include <sys/ipc.h>
  15. #include <sys/msg.h>
  16. #include <sys/un.h>
  17. #include <stddef.h>
  18. #include <sys/resource.h>
  19. #include <sys/utsname.h>
  20. #include <sys/times.h>
  21. #include <signal.h>
  22. #include <sys/select.h>
  23. #include <sys/uio.h>
  24. #include <sys/sem.h>
  25. #include <sys/statvfs.h>
  26. #include <sys/time.h>
  27. #include <utime.h>
  28. #include <wordexp.h>
  29. #include <sys/socket.h>
  30. int main(int argc, char *argv[])
  31. {
  32. printf("dirent %zu %zu\n", sizeof(struct dirent), _Alignof(struct dirent));
  33. printf("flock %zu %zu\n", sizeof(struct flock), _Alignof(struct flock));
  34. printf("glob_t %zu %zu\n", sizeof(glob_t), _Alignof(glob_t));
  35. printf("group %zu %zu\n", sizeof(struct group), _Alignof(struct group));
  36. printf("lconv %zu %zu\n", sizeof(struct lconv), _Alignof(struct lconv));
  37. printf("pthread_t %zu %zu\n", sizeof(pthread_t), _Alignof(pthread_t));
  38. printf("pthread_attr_t %zu %zu\n", sizeof(pthread_attr_t), _Alignof(pthread_attr_t));
  39. printf("pthread_key_t %zu %zu\n", sizeof(pthread_key_t), _Alignof(pthread_key_t));
  40. printf("sched_param %zu %zu\n", sizeof(struct sched_param), _Alignof(struct sched_param));
  41. printf("termios %zu %zu\n", sizeof(struct termios), _Alignof(struct termios));
  42. printf("in_addr %zu %zu\n", sizeof(struct in_addr), _Alignof(struct in_addr));
  43. printf("in6_addr %zu %zu\n", sizeof(struct in6_addr), _Alignof(struct in6_addr));
  44. printf("sockaddr_in %zu %zu\n", sizeof(struct sockaddr_in), _Alignof(struct sockaddr_in));
  45. printf("sockaddr_in6 %zu %zu\n", sizeof(struct sockaddr_in6), _Alignof(struct sockaddr_in6));
  46. printf("ipv6_mreq %zu %zu\n", sizeof(struct ipv6_mreq), _Alignof(struct ipv6_mreq));
  47. printf("sockaddr_storage %zu %zu\n", sizeof(struct sockaddr_storage), _Alignof(struct sockaddr_storage));
  48. printf("msghdr %zu %zu\n", sizeof(struct msghdr), _Alignof(struct msghdr));
  49. printf("cmsghdr %zu %zu\n", sizeof(struct cmsghdr), _Alignof(struct cmsghdr));
  50. printf("linger %zu %zu\n", sizeof(struct linger), _Alignof(struct linger));
  51. printf("hostent %zu %zu\n", sizeof(struct hostent), _Alignof(struct hostent));
  52. printf("netent %zu %zu\n", sizeof(struct netent), _Alignof(struct netent));
  53. printf("protoent %zu %zu\n", sizeof(struct protoent), _Alignof(struct protoent));
  54. printf("servent %zu %zu\n", sizeof(struct servent), _Alignof(struct servent));
  55. printf("addrinfo %zu %zu\n", sizeof(struct addrinfo), _Alignof(struct addrinfo));
  56. printf("pollfd %zu %zu\n", sizeof(struct pollfd), _Alignof(struct pollfd));
  57. printf("passwd %zu %zu\n", sizeof(struct passwd), _Alignof(struct passwd));
  58. printf("shmid_ds %zu %zu\n", sizeof(struct shmid_ds), _Alignof(struct shmid_ds));
  59. printf("ipc_perm %zu %zu\n", sizeof(struct ipc_perm), _Alignof(struct ipc_perm));
  60. printf("msqid_ds %zu %zu\n", sizeof(struct msqid_ds), _Alignof(struct msqid_ds));
  61. printf("rlimit %zu %zu\n", sizeof(struct rlimit), _Alignof(struct rlimit));
  62. printf("rusage %zu %zu\n", sizeof(struct rusage), _Alignof(struct rusage));
  63. printf("sockaddr_un %zu %zu\n", sizeof(struct sockaddr_un), _Alignof(struct sockaddr_un));
  64. printf("utsname %zu %zu\n", sizeof(struct utsname), _Alignof(struct utsname));
  65. printf("tms %zu %zu\n", sizeof(struct tms), _Alignof(struct tms));
  66. printf("sigaction %zu %zu\n", sizeof(struct sigaction), _Alignof(struct sigaction));
  67. printf("stack_t %zu %zu\n", sizeof(stack_t), _Alignof(stack_t));
  68. printf("siginfo_t %zu %zu\n", sizeof(siginfo_t), _Alignof(siginfo_t));
  69. printf("fd_set %zu %zu\n", sizeof(fd_set), _Alignof(fd_set));
  70. printf("iovec %zu %zu\n", sizeof(struct iovec), _Alignof(struct iovec));
  71. printf("semid_ds %zu %zu\n", sizeof(struct semid_ds), _Alignof(struct semid_ds));
  72. printf("sembuf %zu %zu\n", sizeof(struct sembuf), _Alignof(struct sembuf));
  73. printf("itimerval %zu %zu\n", sizeof(struct itimerval), _Alignof(struct itimerval));
  74. printf("utimbuf %zu %zu\n", sizeof(struct utimbuf), _Alignof(struct utimbuf));
  75. printf("wordexp_t %zu %zu\n", sizeof(wordexp_t), _Alignof(wordexp_t));
  76. printf("time_t %zu %zu\n", sizeof(time_t), _Alignof(time_t));
  77. printf("timespec %zu %zu\n", sizeof(struct timespec), _Alignof(struct timespec));
  78. printf("clock_t %zu %zu\n", sizeof(clock_t), _Alignof(clock_t));
  79. return 0;
  80. }