blob: 3a2aa4ea71b5ef523ad23759967efd62bef639a9 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#! /bin/sh
2
3basedir="."
4
5# make sure to use the same locale everywhere.
6LC_ALL=C
7export LC_ALL
8LANG=C
9export LANG
10
11for suffix in _glibc ''
12do
13binary=$basedir/getconf$suffix
14logfile=$basedir/tst-getconf$suffix.out
15rm -f $logfile
16
17result=0
18while 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
28done <<EOF
29AIO_LISTIO_MAX
30AIO_MAX
31AIO_PRIO_DELTA_MAX
32ARG_MAX
33ATEXIT_MAX
34BC_BASE_MAX
35BC_DIM_MAX
36BC_SCALE_MAX
37BC_STRING_MAX
38CHILD_MAX
39COLL_WEIGHTS_MAX
40DELAYTIMER_MAX
41EXPR_NEST_MAX
42HOST_NAME_MAX
43IOV_MAX
44LINE_MAX
45LOGIN_NAME_MAX
46NGROUPS_MAX
47MQ_OPEN_MAX
48MQ_PRIO_MAX
49OPEN_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
119POSIX2_C_BIND
120POSIX2_C_DEV
121POSIX2_C_VERSION
122POSIX2_CHAR_TERM
123POSIX2_FORT_DEV
124POSIX2_FORT_RUN
125POSIX2_LOCALEDEF
126POSIX2_PBS
127POSIX2_PBS_ACCOUNTING
128POSIX2_PBS_LOCATE
129POSIX2_PBS_MESSAGE
130POSIX2_PBS_TRACK
131POSIX2_SW_DEV
132POSIX2_UPE
133POSIX2_VERSION
134_REGEX_VERSION
135PAGE_SIZE
136PAGESIZE
137PTHREAD_DESTRUCTOR_ITERATIONS
138PTHREAD_KEYS_MAX
139PTHREAD_STACK_MIN
140PTHREAD_THREADS_MAX
141RE_DUP_MAX
142RTSIG_MAX
143SEM_NSEMS_MAX
144SEM_VALUE_MAX
145SIGQUEUE_MAX
146STREAM_MAX
147SYMLOOP_MAX
148TIMER_MAX
149TTY_NAME_MAX
150TZNAME_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
164PATH
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
199EOF
200
201while 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
208done <<EOF
209FILESIZEBITS
210LINK_MAX
211MAX_CANON
212MAX_INPUT
213NAME_MAX
214PATH_MAX
215PIPE_BUF
216POSIX_ALLOC_SIZE_MIN
217POSIX_REC_INCR_XFER_SIZE
218POSIX_REC_MAX_XFER_SIZE
219POSIX_REC_MIN_XFER_SIZE
220POSIX_REC_XFER_ALIGN
221SYMLINK_MAX
222_POSIX_CHOWN_RESTRICTED
223_POSIX_NO_TRUNC
224_POSIX_VDISABLE
225_POSIX_ASYNC_IO
226_POSIX_PRIO_IO
227_POSIX_SYNC_IO
228EOF
229
230done
231exit $result
232
233# Preserve executable bits for this shell script.
234Local Variables:
235eval:(defun frobme () (set-file-modes buffer-file-name file-mode))
236eval:(make-local-variable 'file-mode)
237eval:(setq file-mode (file-modes (buffer-file-name)))
238eval:(make-local-variable 'after-save-hook)
239eval:(add-hook 'after-save-hook 'frobme)
240End: