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