t_linux.h2paschk 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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 {$i ptypes.inc}
  11. @Pascal {$i ostypes.inc}
  12. @Pascal begin
  13. @C #define _LARGEFILE_SOURCE 1
  14. @C #define _FILE_OFFSET_BITS 64
  15. ## @C #define _USE_FILE_OFFSET64
  16. ## @C #ifdef __i386__
  17. ## @C #define _LARGEFILE64_SOURCE
  18. ## @C #endif
  19. @C #include <sys/types.h>
  20. @C #include <sys/stat.h>
  21. @C #include <sys/statfs.h>
  22. @C #include <sys/mount.h>
  23. @C #include <sys/time.h>
  24. @C #include <sys/times.h>
  25. @C #include <sys/resource.h>
  26. @C #include <sys/uio.h>
  27. @C #include <dirent.h>
  28. @C #include <poll.h>
  29. @C #include <utime.h>
  30. @C #include <fcntl.h>
  31. @C #include <unistd.h>
  32. @C #include <stdio.h>
  33. @C #include <stddef.h>
  34. @C int main()
  35. @C {
  36. @type dev_t
  37. @type gid_t
  38. @type ino_t
  39. @type mode_t
  40. @type nlink_t
  41. @type off_t
  42. @type pid_t
  43. @type size_t
  44. @type ssize_t
  45. @type uid_t
  46. @type clock_t
  47. @type time_t
  48. @type socklen_t
  49. @record timeval,struct timeval
  50. .tv_sec
  51. .tv_usec
  52. @record timespec,struct timespec
  53. .tv_sec
  54. .tv_nsec
  55. @type pthread_t
  56. @type pthread_attr_t
  57. @type pthread_mutex_t
  58. @type pthread_mutexattr_t
  59. @type pthread_cond_t
  60. @type pthread_condattr_t
  61. @type pthread_key_t
  62. @type pthread_rwlock_t
  63. @type pthread_rwlockattr_t
  64. @type rlim_t
  65. @record stat,struct stat
  66. .st_dev
  67. .st_ino
  68. .st_mode
  69. #.st_padding0
  70. .st_nlink
  71. .st_uid
  72. .st_gid
  73. #.st_padding1
  74. .st_rdev
  75. .st_size
  76. .st_blocks
  77. .st_blksize
  78. .st_atime,st_atim.tv_sec
  79. .st_atime_nsec,st_atim.tv_nsec
  80. .st_mtime,st_mtim.tv_sec
  81. .st_mtime_nsec,st_mtim.tv_nsec
  82. .st_ctime,st_ctim.tv_sec
  83. .st_ctime_nsec,st_ctim.tv_nsec
  84. @Pascal {$if defined (CPUPOWERPC) or defined(CPUPOWERPC64)}
  85. @C #ifdef __powerpc__
  86. .__unused4
  87. .__unused5
  88. @Pascal {$ifdef CPU64}
  89. @C #ifdef __LP64__
  90. .__unused6
  91. @C #endif
  92. @Pascal {$endif CPU64}
  93. @C #endif
  94. @Pascal {$endif powerpc}
  95. #.st_flags
  96. #.st_gen
  97. @record dirent,struct dirent
  98. .d_fileno
  99. .d_off
  100. .d_reclen
  101. .d_type
  102. #.d_pad0
  103. #.d_namlen
  104. #.d_pad1
  105. .d_name
  106. @record TStatFs,struct statfs
  107. .fstype,f_type
  108. .bsize,f_bsize
  109. .blocks,f_blocks
  110. .bfree,f_bfree
  111. .bavail,f_bavail
  112. .files,f_files
  113. .ffree,f_ffree
  114. .fsid,f_fsid
  115. .namelen,f_namelen
  116. .frsize,f_frsize
  117. .flags,f_flags
  118. .spare,f_spare
  119. @record pollfd,struct pollfd
  120. .fd
  121. .events
  122. .revents
  123. @record utimbuf,struct utimbuf
  124. .actime
  125. .modtime
  126. @record flock,struct flock
  127. .l_start
  128. .l_len
  129. .l_pid
  130. .l_type
  131. .l_whence
  132. @record tms,struct tms
  133. .tms_utime
  134. .tms_stime
  135. .tms_cutime
  136. .tms_cstime
  137. @record timezone,struct timezone
  138. .tz_minuteswest
  139. .tz_dsttime
  140. #@record rusage,struct rusage
  141. #.ru_utime
  142. #.ru_stime
  143. #.ru_maxrss
  144. #.ru_ixrss
  145. #.ru_idrss
  146. #.ru_isrss
  147. #.ru_minflt
  148. #.ru_majflt
  149. #.ru_nswap
  150. #.ru_inblock
  151. #.ru_oublock
  152. #.ru_msgsnd
  153. #.ru_msgrcv
  154. #.ru_nsignals
  155. #.ru_nvcsw
  156. #.ru_nivcsw
  157. @record TRLimit,struct rlimit
  158. .rlim_cur
  159. .rlim_max
  160. @record iovec,struct iovec
  161. .iov_base
  162. .iov_len
  163. @C return 0;
  164. @C }
  165. @Pascal end.