tst-getconf.sh 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. #! /bin/sh
  2. basedir="."
  3. # make sure to use the same locale everywhere.
  4. LC_ALL=C
  5. export LC_ALL
  6. LANG=C
  7. export LANG
  8. for suffix in _glibc ''
  9. do
  10. binary=$basedir/getconf$suffix
  11. logfile=$basedir/tst-getconf$suffix.out
  12. rm -f $logfile
  13. result=0
  14. while read name; do
  15. case "$name" in
  16. "#"*) continue;;
  17. esac
  18. echo -n "getconf $name: " >> $logfile
  19. $binary "$name" 2>> $logfile >> $logfile
  20. if test $? -ne 0; then
  21. echo "*** $name FAILED" >> $logfile
  22. result=1
  23. fi
  24. done <<EOF
  25. AIO_LISTIO_MAX
  26. AIO_MAX
  27. AIO_PRIO_DELTA_MAX
  28. ARG_MAX
  29. ATEXIT_MAX
  30. BC_BASE_MAX
  31. BC_DIM_MAX
  32. BC_SCALE_MAX
  33. BC_STRING_MAX
  34. CHILD_MAX
  35. COLL_WEIGHTS_MAX
  36. DELAYTIMER_MAX
  37. EXPR_NEST_MAX
  38. HOST_NAME_MAX
  39. IOV_MAX
  40. LINE_MAX
  41. LOGIN_NAME_MAX
  42. NGROUPS_MAX
  43. MQ_OPEN_MAX
  44. MQ_PRIO_MAX
  45. OPEN_MAX
  46. _POSIX_ADVISORY_INFO
  47. _POSIX_BARRIERS
  48. _POSIX_ASYNCHRONOUS_IO
  49. _POSIX_BASE
  50. _POSIX_C_LANG_SUPPORT
  51. _POSIX_C_LANG_SUPPORT_R
  52. _POSIX_CLOCK_SELECTION
  53. _POSIX_CPUTIME
  54. _POSIX_DEVICE_IO
  55. _POSIX_DEVICE_SPECIFIC
  56. _POSIX_DEVICE_SPECIFIC_R
  57. _POSIX_FD_MGMT
  58. _POSIX_FIFO
  59. _POSIX_FILE_ATTRIBUTES
  60. _POSIX_FILE_LOCKING
  61. _POSIX_FILE_SYSTEM
  62. _POSIX_FSYNC
  63. _POSIX_JOB_CONTROL
  64. _POSIX_MAPPED_FILES
  65. _POSIX_MEMLOCK
  66. _POSIX_MEMLOCK_RANGE
  67. _POSIX_MEMORY_PROTECTION
  68. _POSIX_MESSAGE_PASSING
  69. _POSIX_MONOTONIC_CLOCK
  70. _POSIX_MULTI_PROCESS
  71. _POSIX_NETWORKING
  72. _POSIX_PIPE
  73. _POSIX_PRIORITIZED_IO
  74. _POSIX_PRIORITY_SCHEDULING
  75. _POSIX_READER_WRITER_LOCKS
  76. _POSIX_REALTIME_SIGNALS
  77. _POSIX_REGEXP
  78. _POSIX_SAVED_IDS
  79. _POSIX_SEMAPHORES
  80. _POSIX_SHARED_MEMORY_OBJECTS
  81. _POSIX_SHELL
  82. _POSIX_SIGNALS
  83. _POSIX_SINGLE_PROCESS
  84. _POSIX_SPAWN
  85. _POSIX_SPIN_LOCKS
  86. _POSIX_SPORADIC_SERVER
  87. _POSIX_SYNCHRONIZED_IO
  88. _POSIX_SYSTEM_DATABASE
  89. _POSIX_SYSTEM_DATABASE_R
  90. _POSIX_THREAD_ATTR_STACKADDR
  91. _POSIX_THREAD_ATTR_STACKSIZE
  92. _POSIX_THREAD_CPUTIME
  93. _POSIX_THREAD_PRIO_INHERIT
  94. _POSIX_THREAD_PRIO_PROTECT
  95. _POSIX_THREAD_PRIORITY_SCHEDULING
  96. _POSIX_THREAD_PROCESS_SHARED
  97. _POSIX_THREAD_SAFE_FUNCTIONS
  98. _POSIX_THREAD_SPORADIC_SERVER
  99. _POSIX_THREADS
  100. _POSIX_TIMEOUTS
  101. _POSIX_TIMERS
  102. _POSIX_TRACE
  103. _POSIX_TRACE_EVENT_FILTER
  104. _POSIX_TRACE_INHERIT
  105. _POSIX_TRACE_LOG
  106. _POSIX_TYPED_MEMORY_OBJECTS
  107. _POSIX_USER_GROUPS
  108. _POSIX_USER_GROUPS_R
  109. _POSIX_VERSION
  110. _POSIX_V7_ILP32_OFF32
  111. _POSIX_V7_ILP32_OFFBIG
  112. _POSIX_V7_LP64_OFF64
  113. _POSIX_V7_LPBIG_OFFBIG
  114. #_POSIX_V7_WIDTH_RESTRICTED_ENVS
  115. POSIX2_C_BIND
  116. POSIX2_C_DEV
  117. POSIX2_C_VERSION
  118. POSIX2_CHAR_TERM
  119. POSIX2_FORT_DEV
  120. POSIX2_FORT_RUN
  121. POSIX2_LOCALEDEF
  122. POSIX2_PBS
  123. POSIX2_PBS_ACCOUNTING
  124. POSIX2_PBS_LOCATE
  125. POSIX2_PBS_MESSAGE
  126. POSIX2_PBS_TRACK
  127. POSIX2_SW_DEV
  128. POSIX2_UPE
  129. POSIX2_VERSION
  130. _REGEX_VERSION
  131. PAGE_SIZE
  132. PAGESIZE
  133. PTHREAD_DESTRUCTOR_ITERATIONS
  134. PTHREAD_KEYS_MAX
  135. PTHREAD_STACK_MIN
  136. PTHREAD_THREADS_MAX
  137. RE_DUP_MAX
  138. RTSIG_MAX
  139. SEM_NSEMS_MAX
  140. SEM_VALUE_MAX
  141. SIGQUEUE_MAX
  142. STREAM_MAX
  143. SYMLOOP_MAX
  144. TIMER_MAX
  145. TTY_NAME_MAX
  146. TZNAME_MAX
  147. #_XBS5_ILP32_OFF32
  148. #_XBS5_ILP32_OFFBIG
  149. #_XBS5_LP64_OFF64
  150. #_XBS5_LPBIG_OFFBIG
  151. _XOPEN_CRYPT
  152. _XOPEN_ENH_I18N
  153. _XOPEN_LEGACY
  154. _XOPEN_REALTIME
  155. _XOPEN_REALTIME_THREADS
  156. _XOPEN_SHM
  157. _XOPEN_UNIX
  158. _XOPEN_VERSION
  159. _XOPEN_XCU_VERSION
  160. PATH
  161. #POSIX_V7_ILP32_OFF32_CFLAGS
  162. #POSIX_V7_ILP32_OFF32_LDFLAGS
  163. #POSIX_V7_ILP32_OFF32_LIBS
  164. #POSIX_V7_ILP32_OFF32_LINTFLAGS
  165. #POSIX_V7_ILP32_OFFBIG_CFLAGS
  166. #POSIX_V7_ILP32_OFFBIG_LDFLAGS
  167. #POSIX_V7_ILP32_OFFBIG_LIBS
  168. #POSIX_V7_ILP32_OFFBIG_LINTFLAGS
  169. #POSIX_V7_LP64_OFF64_CFLAGS
  170. #POSIX_V7_LP64_OFF64_LDFLAGS
  171. #POSIX_V7_LP64_OFF64_LIBS
  172. #POSIX_V7_LP64_OFF64_LINTFLAGS
  173. #POSIX_V7_LPBIG_OFFBIG_CFLAGS
  174. #POSIX_V7_LPBIG_OFFBIG_LDFLAGS
  175. #POSIX_V7_LPBIG_OFFBIG_LIBS
  176. #POSIX_V7_LPBIG_OFFBIG_LINTFLAGS
  177. #XBS5_ILP32_OFF32_CFLAGS
  178. #XBS5_ILP32_OFF32_LDFLAGS
  179. #XBS5_ILP32_OFF32_LIBS
  180. #XBS5_ILP32_OFF32_LINTFLAGS
  181. #XBS5_ILP32_OFFBIG_CFLAGS
  182. #XBS5_ILP32_OFFBIG_LDFLAGS
  183. #XBS5_ILP32_OFFBIG_LIBS
  184. #XBS5_ILP32_OFFBIG_LINTFLAGS
  185. #XBS5_LP64_OFF64_CFLAGS
  186. #XBS5_LP64_OFF64_LDFLAGS
  187. #XBS5_LP64_OFF64_LIBS
  188. #XBS5_LP64_OFF64_LINTFLAGS
  189. #XBS5_LPBIG_OFFBIG_CFLAGS
  190. #XBS5_LPBIG_OFFBIG_LDFLAGS
  191. #XBS5_LPBIG_OFFBIG_LIBS
  192. #XBS5_LPBIG_OFFBIG_LINTFLAGS
  193. _NPROCESSORS_ONLN
  194. _NPROCESSORS_CONF
  195. EOF
  196. while read name; do
  197. echo -n "getconf $name /: " >> $logfile
  198. $binary "$name" / 2>> $logfile >> $logfile
  199. if test $? -ne 0; then
  200. echo "*** $name FAILED" >> $logfile
  201. result=1
  202. fi
  203. done <<EOF
  204. FILESIZEBITS
  205. LINK_MAX
  206. MAX_CANON
  207. MAX_INPUT
  208. NAME_MAX
  209. PATH_MAX
  210. PIPE_BUF
  211. POSIX_ALLOC_SIZE_MIN
  212. POSIX_REC_INCR_XFER_SIZE
  213. POSIX_REC_MAX_XFER_SIZE
  214. POSIX_REC_MIN_XFER_SIZE
  215. POSIX_REC_XFER_ALIGN
  216. SYMLINK_MAX
  217. _POSIX_CHOWN_RESTRICTED
  218. _POSIX_NO_TRUNC
  219. _POSIX_VDISABLE
  220. _POSIX_ASYNC_IO
  221. _POSIX_PRIO_IO
  222. _POSIX_SYNC_IO
  223. EOF
  224. done
  225. exit $result
  226. # Preserve executable bits for this shell script.
  227. Local Variables:
  228. eval:(defun frobme () (set-file-modes buffer-file-name file-mode))
  229. eval:(make-local-variable 'file-mode)
  230. eval:(setq file-mode (file-modes (buffer-file-name)))
  231. eval:(make-local-variable 'after-save-hook)
  232. eval:(add-hook 'after-save-hook 'frobme)
  233. End: