t_linux.h2paschk 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. # OpenBSD RTL-to-C structure compatibility checker description file
  2. #
  3. # Use
  4. # h2paschk t_openbsd.h2paschk
  5. #
  6. # ...to generate Pascal and C code, then make sure they both compile and that
  7. # the Pascal program produces the same output as the C program for each
  8. # supported architecture.
  9. @Pascal uses baseunix;
  10. @Pascal begin
  11. @C #define _LARGEFILE_SOURCE 1
  12. @C #define _FILE_OFFSET_BITS 64
  13. ## @C #define _USE_FILE_OFFSET64
  14. @C #include <sys/types.h>
  15. @C #include <sys/stat.h>
  16. @C #include <sys/statfs.h>
  17. @C #include <sys/mount.h>
  18. @C #include <sys/time.h>
  19. @C #include <sys/times.h>
  20. @C #include <sys/resource.h>
  21. @C #include <sys/uio.h>
  22. @C #include <dirent.h>
  23. @C #include <poll.h>
  24. @C #include <utime.h>
  25. @C #include <fcntl.h>
  26. @C #include <unistd.h>
  27. @C #include <stdio.h>
  28. @C #include <stddef.h>
  29. @C int main()
  30. @C {
  31. @record timespec,struct timespec
  32. .tv_sec
  33. .tv_nsec
  34. @record stat,struct stat
  35. .st_dev
  36. .st_ino
  37. .st_mode
  38. #.st_padding0
  39. .st_nlink
  40. .st_uid
  41. .st_gid
  42. #.st_padding1
  43. .st_rdev
  44. .st_size
  45. .st_blocks
  46. .st_blksize
  47. .st_atime,st_atim.tv_sec
  48. .st_atime_nsec,st_atim.tv_nsec
  49. .st_mtime,st_mtim.tv_sec
  50. .st_mtime_nsec,st_mtim.tv_nsec
  51. .st_ctime,st_ctim.tv_sec
  52. .st_ctime_nsec,st_ctim.tv_nsec
  53. @Pascal {$if defined (CPUPOWERPC) or defined(CPUPOWERPC64)}
  54. @C #ifdef __powerpc__
  55. .__unused4
  56. .__unused5
  57. @Pascal {$ifdef CPU64}
  58. @C #ifdef __LP64__
  59. .__unused6
  60. @C #endif
  61. @Pascal {$endif CPU64}
  62. @C #endif
  63. @Pascal {$endif powerpc}
  64. #.st_flags
  65. #.st_gen
  66. @record dirent,struct dirent
  67. .d_fileno
  68. .d_off
  69. .d_reclen
  70. .d_type
  71. #.d_pad0
  72. #.d_namlen
  73. #.d_pad1
  74. .d_name
  75. @record TStatFs,struct statfs
  76. .fstype,f_type
  77. .bsize,f_bsize
  78. .blocks,f_blocks
  79. .bfree,f_bfree
  80. .bavail,f_bavail
  81. .files,f_files
  82. .ffree,f_ffree
  83. .fsid,f_fsid
  84. .namelen,f_namelen
  85. .frsize,f_frsize
  86. .flags,f_flags
  87. .spare,f_spare
  88. @record pollfd,struct pollfd
  89. .fd
  90. .events
  91. .revents
  92. @record utimbuf,struct utimbuf
  93. .actime
  94. .modtime
  95. @record flock,struct flock
  96. .l_start
  97. .l_len
  98. .l_pid
  99. .l_type
  100. .l_whence
  101. @record tms,struct tms
  102. .tms_utime
  103. .tms_stime
  104. .tms_cutime
  105. .tms_cstime
  106. @record timezone,struct timezone
  107. .tz_minuteswest
  108. .tz_dsttime
  109. #@record rusage,struct rusage
  110. #.ru_utime
  111. #.ru_stime
  112. #.ru_maxrss
  113. #.ru_ixrss
  114. #.ru_idrss
  115. #.ru_isrss
  116. #.ru_minflt
  117. #.ru_majflt
  118. #.ru_nswap
  119. #.ru_inblock
  120. #.ru_oublock
  121. #.ru_msgsnd
  122. #.ru_msgrcv
  123. #.ru_nsignals
  124. #.ru_nvcsw
  125. #.ru_nivcsw
  126. @record TRLimit,struct rlimit
  127. .rlim_cur
  128. .rlim_max
  129. @record iovec,struct iovec
  130. .iov_base
  131. .iov_len
  132. @C return 0;
  133. @C }
  134. @Pascal end.