1 '\" te 2 .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved 3 .\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved 4 .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures 5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. 6 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text 7 .\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical 8 .\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. 9 .\" This notice shall appear on any product containing this material. 10 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. 11 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with 12 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] 13 .TH GETCONF 1 "Sep 1, 2009" 14 .SH NAME 15 getconf \- get configuration values 16 .SH SYNOPSIS 17 .SS "/usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf" 18 .LP 19 .nf 20 \fB/usr/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIsystem_var\fR 21 .fi 22 23 .LP 24 .nf 25 \fB/usr/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIpath_var\fR \fIpathname\fR 26 .fi 27 28 .LP 29 .nf 30 \fB/usr/bin/getconf\fR \fB-a\fR 31 .fi 32 33 .LP 34 .nf 35 \fB/usr/xpg4/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIsystem_var\fR 36 .fi 37 38 .LP 39 .nf 40 \fB/usr/xpg4/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIpath_var\fR \fIpathname\fR 41 .fi 42 43 .LP 44 .nf 45 \fB/usr/xpg4/bin/getconf\fR \fB-a\fR 46 .fi 47 48 .LP 49 .nf 50 \fB/usr/xpg6/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIsystem_var\fR 51 .fi 52 53 .LP 54 .nf 55 \fB/usr/xpg6/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIpath_var\fR \fIpathname\fR 56 .fi 57 58 .LP 59 .nf 60 \fB/usr/xpg6/bin/getconf\fR \fB-a\fR 61 .fi 62 63 .SS "ksh93" 64 .LP 65 .nf 66 \fBgetconf\fR [\fB-abdlpqrtw\fR] [\fB-c\fR RE] [\fB-n\fR RE] [\fB-s\fR RE] [\fB-v\fR \fIname\fR][\fIname\fR [\fIpath\fR [\fIvalue\fR]] ...] 67 .fi 68 69 .SH DESCRIPTION 70 .SS "/usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf" 71 .sp 72 .LP 73 In the first synopsis form, the \fBgetconf\fR utility writes to the standard 74 output the value of the variable specified by \fIsystem_var\fR, in accordance 75 with \fIspecification\fR if the \fB-v\fR option is used. 76 .sp 77 .LP 78 In the second synopsis form, \fBgetconf\fR writes to the standard output the 79 value of the variable specified by \fIpath_var\fR for the path specified by 80 \fIpathname\fR, in accordance with \fIspecification\fR if the \fB-v\fR option 81 is used. 82 .sp 83 .LP 84 In the third synopsis form, \fBconfig\fR writes to the standard output the 85 names of the current system configuration variables. 86 .sp 87 .LP 88 The value of each configuration variable is determined as if it were obtained 89 by calling the function from which it is defined to be available. The value 90 reflects conditions in the current operating environment. 91 .SS "ksh93" 92 .sp 93 .LP 94 The \fBgetconf\fR built-in in \fBksh93\fR is associated with the \fB/bin\fR and 95 \fB/usr/bin\fR paths. It is invoked when \fBgetconf\fR is executed without a 96 pathname prefix and the pathname search finds a \fB/bin/getconf\fR or 97 \fB/usr/bin/getconf\fR executable. 98 .sp 99 .LP 100 \fBgetconf\fR displays the system configuration value for \fIname\fR. If 101 \fIname\fR is a filesystem specific variable, the value is determined relative 102 to path, or, the current directory, if path is omitted. If \fIvalue\fR is 103 specified, \fBgetconf\fR attempts to change the process local value to 104 \fIvalue\fR. \fB-\fR can be used in place of path when it is not relevant. Only 105 writable variables can be set. \fBreadonly\fR variables cannot be changed. 106 .sp 107 .LP 108 The current value for \fIname\fR is written to the standard output. If 109 \fIname\fR is valid but undefined, \fBundefined\fR is written to the standard 110 output. If \fIname\fR is invalid or an error occurs in determining its value, a 111 diagnostic is written to standard error and \fBgetconf\fR exits with a 112 \fBnon-zero\fR exit status. 113 .sp 114 .LP 115 More than one variable can be set or queried by providing the \fIname path 116 value\fR 3-tuple for each variable, specifying \fB-\fR for value when querying. 117 .sp 118 .LP 119 If no operands are specified, all known variables are written in 120 \fIname\fR\fB=\fR\fIvalue\fR form to the standard output, one per line. Only 121 one of \fB--call\fR, \fB--name\fR or \fB--standard\fR can be specified. 122 .SH OPTIONS 123 .SS "/usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf" 124 .sp 125 .LP 126 The following options are supported by \fB/usr/bin/getconf\fR, 127 \fB/usr/xpg4/bin/getconf\fR, and \fB/usr/xpg6/bin/getconf\fR 128 .sp 129 .ne 2 130 .na 131 \fB\fB-a\fR\fR 132 .ad 133 .RS 19n 134 Writes the names of the current system configuration variables to the standard 135 output. 136 .RE 137 138 .sp 139 .ne 2 140 .na 141 \fB\fB-v\fR\fIspecification\fR\fR 142 .ad 143 .RS 19n 144 Gives the specification which governs the selection of values for configuration 145 variables. 146 .RE 147 148 .SS "ksh93" 149 .sp 150 .LP 151 The following options are supported by the \fBgetconf\fR built-in command in 152 \fBksh93\fR: 153 .sp 154 .ne 2 155 .na 156 \fB\fB-a\fR\fR 157 .ad 158 .br 159 .na 160 \fB\fB--all\fR\fR 161 .ad 162 .RS 24n 163 Call the native \fBgetconf -a\fR. 164 .RE 165 166 .sp 167 .ne 2 168 .na 169 \fB\fB-b\fR\fR 170 .ad 171 .br 172 .na 173 \fB\fB--base\fR\fR 174 .ad 175 .RS 24n 176 List base variable name without \fBcall\fR and standard prefixes. 177 .RE 178 179 .sp 180 .ne 2 181 .na 182 \fB\fB-c\fR\fR 183 .ad 184 .br 185 .na 186 \fB\fB--call=\fR\fIRE\fR\fR 187 .ad 188 .RS 24n 189 Display variables with \fBcall\fR prefix that matches \fIRE\fR. The \fBcall\fR 190 prefixes are: 191 .RS +4 192 .TP 193 .ie t \(bu 194 .el o 195 \fBCS\fR 196 .sp 197 \fBconfstr\fR(3C), 198 .RE 199 .RS +4 200 .TP 201 .ie t \(bu 202 .el o 203 \fBPC\fR 204 .sp 205 \fBpathconf\fR(2) 206 .RE 207 .RS +4 208 .TP 209 .ie t \(bu 210 .el o 211 \fBSC\fR 212 .sp 213 \fBsysconf\fR(3C) 214 .RE 215 .RS +4 216 .TP 217 .ie t \(bu 218 .el o 219 \fBSI\fR 220 .sp 221 \fBsysinfo\fR(2) 222 .RE 223 .RS +4 224 .TP 225 .ie t \(bu 226 .el o 227 \fBXX\fR 228 .sp 229 Constant value 230 .RE 231 .RE 232 233 .sp 234 .ne 2 235 .na 236 \fB\fB-d\fR\fR 237 .ad 238 .br 239 .na 240 \fB\fB--defined\fR\fR 241 .ad 242 .RS 24n 243 Only display defined values when no operands are specified. 244 .RE 245 246 .sp 247 .ne 2 248 .na 249 \fB\fB-l\fR\fR 250 .ad 251 .br 252 .na 253 \fB\fB--lowercase\fR\fR 254 .ad 255 .RS 24n 256 List variable names in lower case. 257 .RE 258 259 .sp 260 .ne 2 261 .na 262 \fB\fB-n\fR\fR 263 .ad 264 .br 265 .na 266 \fB\fB--name=\fR\fIRE\fR\fR 267 .ad 268 .RS 24n 269 Display variables with names that match \fIRE\fR. 270 .RE 271 272 .sp 273 .ne 2 274 .na 275 \fB\fB-p\fR\fR 276 .ad 277 .br 278 .na 279 \fB\fB--portable\fR\fR 280 .ad 281 .RS 24n 282 Display the named writable variables and values in a form that can be directly 283 executed by \fBksh93\fR(1) to set the values. If \fIname\fR is omitted, lists 284 all writable variables. 285 .RE 286 287 .sp 288 .ne 2 289 .na 290 \fB\fB-q\fR\fR 291 .ad 292 .br 293 .na 294 \fB\fB--quote\fR\fR 295 .ad 296 .RS 24n 297 Quote values (\fB"..."\fR). 298 .RE 299 300 .sp 301 .ne 2 302 .na 303 \fB\fB-r\fR\fR 304 .ad 305 .br 306 .na 307 \fB\fB--readonly\fR\fR 308 .ad 309 .RS 24n 310 Display the named \fBreadonly\fR variables in \fIname\fR\fB=\fR\fIvalue\fR 311 form. If \fIname\fR is omitted, lists all \fBreadonly\fR variables. 312 .RE 313 314 .sp 315 .ne 2 316 .na 317 \fB\fB-s\fR\fR 318 .ad 319 .br 320 .na 321 \fB\fB--standard=\fR\fIRE\fR\fR 322 .ad 323 .RS 24n 324 Display variables with standard prefix that matches \fIRE\fR. Use the 325 \fB--table\fR option to view all standard prefixes, including local additions. 326 .sp 327 The standard prefixes available on all systems are: 328 .sp 329 .in +2 330 .nf 331 332 AES 333 AST 334 C 335 GNU 336 POSIX 337 SVID 338 XBS5 339 XOPEN 340 XPG 341 .fi 342 .in -2 343 .sp 344 345 .RE 346 347 .sp 348 .ne 2 349 .na 350 \fB\fB-t\fR\fR 351 .ad 352 .br 353 .na 354 \fB\fB--table\fR\fR 355 .ad 356 .RS 24n 357 Display the internal table that contains the name, standard, standard section, 358 and system call symbol prefix for each variable. 359 .RE 360 361 .sp 362 .ne 2 363 .na 364 \fB\fB-w\fR\fR 365 .ad 366 .br 367 .na 368 \fB\fB--writable\fR\fR 369 .ad 370 .RS 24n 371 Display the named writable variables in \fIname\fR\fB=\fR\fIvalue\fR form. If 372 \fIname\fR is omitted, lists all writable variables. 373 .RE 374 375 .sp 376 .ne 2 377 .na 378 \fB\fB-v\fR\fR 379 .ad 380 .br 381 .na 382 \fB\fB--specification=name\fR\fR 383 .ad 384 .RS 24n 385 Call the native \fBgetconf -v\fR \fIname\fR. 386 .RE 387 388 .SH OPERANDS 389 .SS "/usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf" 390 .sp 391 .LP 392 The following operands are supported by \fB/usr/bin/getconf\fR, 393 \fB/usr/xpg4/bin/getconf\fR, and \fB/usr/xpg6/bin/getconf\fR: 394 .sp 395 .ne 2 396 .na 397 \fB\fIpath_var\fR\fR 398 .ad 399 .RS 12n 400 A name of a configuration variable whose value is available from the 401 \fBpathconf\fR(2) function. All of the values in the following table are 402 supported: 403 .RE 404 405 .sp 406 407 .sp 408 .TS 409 l l l 410 l l l . 411 LINK_MAX NAME_MAX _POSIX_CHOWN_RESTRICTED 412 MAX_CANON PATH_MAX _POSIX_NO_TRUNC 413 MAX_INPUT PIPE_BUF _POSIX_VDISABLE 414 .TE 415 416 .sp 417 .ne 2 418 .na 419 \fB\fIpathname\fR\fR 420 .ad 421 .RS 14n 422 A path name for which the variable specified by \fIpath_var\fR is to be 423 determined. 424 .RE 425 426 .sp 427 .ne 2 428 .na 429 \fB\fIsystem_var\fR\fR 430 .ad 431 .RS 14n 432 A name of a configuration variable whose value is available from 433 \fBconfstr\fR(3C) or \fBsysconf\fR(3C). All of the values in the following 434 table are supported: 435 .RE 436 437 .sp 438 439 .sp 440 .TS 441 l l 442 l l . 443 ARG_MAX BC_BASE_MAX 444 BC_DIM_MAX BC_SCALE_MAX 445 BC_STRING_MAX CHAR_BIT 446 CHARCLASS_NAME_MAX CHAR_MAX 447 CHAR_MIN CHILD_MAX 448 CLK_TCK COLL_WEIGHTS_MAX 449 CS_PATH EXPR_NEST_MAX 450 HOST_NAME_MAX INT_MAX 451 INT_MIN LFS64_CFLAGS 452 LFS64_LDFLAGS LFS64_LIBS 453 LFS64_LINTFLAGS LFS_CFLAGS 454 LFS_LDFLAGS LFS_LIBS 455 LFS_LINTFLAGS LINE_MAX 456 LONG_BIT LONG_MAX 457 LONG_MIN MB_LEN_MAX 458 NGROUPS_MAX NL_ARGMAX 459 NL_LANGMAX NL_MSGMAX 460 NL_NMAX NL_SETMAX 461 NL_TEXTMAX NZERO 462 OPEN_MAX POSIX2_BC_BASE_MAX 463 POSIX2_BC_DIM_MAX POSIX2_BC_SCALE_MAX 464 POSIX2_BC_STRING_MAX POSIX2_C_BIND 465 POSIX2_C_DEV POSIX2_CHAR_TERM 466 POSIX2_COLL_WEIGHTS_MAX POSIX2_C_VERSION 467 POSIX2_EXPR_NEST_MAX POSIX2_FORT_DEV 468 POSIX2_FORT_RUN POSIX2_LINE_MAX 469 POSIX2_LOCALEDEF POSIX2_RE_DUP_MAX 470 POSIX2_SW_DEV POSIX2_SYMLINKS 471 POSIX2_UPE POSIX2_VERSION 472 POSIX_ALLOC_SIZE_MIN POSIX_REC_INCR_XFER_SIZE 473 POSIX_REC_MAX_XFER_SIZE POSIX_REC_MIN_XFER_SIZE 474 POSIX_REC_XFER_ALIGN POSIX_V6_ILP32_OFF32 475 POSIX_V6_ILP32_OFF32_CFLAGS POSIX_V6_ILP32_OFF32_LDFLAGS 476 POSIX_V6_ILP32_OFF32_LIBS POSIX_V6_ILP32_OFFBIG 477 POSIX_V6_ILP32_OFFBIG_CFLAGS POSIX_V6_ILP32_OFFBIG_LDFLAGS 478 POSIX_V6_ILP32_OFFBIG_LIBS POSIX_V6_LP64_OFF64 479 POSIX_V6_LP64_OFF64_CFLAGS POSIX_V6_LP64_OFF64_LDFLAGS 480 POSIX_V6_LP64_OFF64_LIBS POSIX_V6_LPBIG_OFFBIG 481 POSIX_V6_LPBIG_OFFBIG_CFLAGS POSIX_V6_LPBIG_OFFBIG_LDFLAGS 482 POSIX_V6_LPBIG_OFFBIG_LIBS POSIX_V6_WIDTH_RESTRICTED_ENVS 483 SYMLINK_MAX SYMLOOP_MAX 484 _POSIX2_BC_BASE_MAX _POSIX2_BC_DIM_MAX 485 _POSIX2_BC_SCALE_MAX _POSIX2_BC_STRING_MAX 486 _POSIX2_CHARCLASS_NAME_MAX _POSIX2_CHAR_TERM 487 _POSIX2_COLL_WEIGHTS_MAX _POSIX2_C_BIND 488 _POSIX2_C_DEV _POSIX2_C_VERSION 489 _POSIX2_EXPR_NEST_MAX _POSIX2_FORT_DEV 490 _POSIX2_FORT_RUN _POSIX2_LINE_MAX 491 _POSIX2_LOCALEDEF _POSIX2_PBS 492 _POSIX2_PBS_ACCOUNTING _POSIX2_PBS_CHECKPOINT 493 _POSIX2_PBS_LOCATE _POSIX2_PBS_MESSAGE 494 _POSIX2_PBS_TRACK _POSIX2_RE_DUP_MAX 495 _POSIX2_SW_DEV _POSIX2_UPE 496 _POSIX2_VERSION _POSIX_ADVISORY_INFO 497 _POSIX_AIO_LISTIO_MAX _POSIX_AIO_MAX 498 _POSIX_ARG_MAX _POSIX_ASYNC_IO 499 _POSIX_BARRIERS _POSIX_CHILD_MAX 500 _POSIX_CLOCKRES_MIN _POSIX_CLOCK_SELECTION 501 _POSIX_CPUTIME _POSIX_DELAYTIMER_MAX 502 _POSIX_HOST_NAME_MAX _POSIX_IPV6 503 _POSIX_JOB_CONTROL _POSIX_LINK_MAX 504 _POSIX_LOGIN_NAME_MAX _POSIX_MAX_CANON 505 _POSIX_MAX_INPUT _POSIX_MONOTONIC_CLOCK 506 _POSIX_MQ_OPEN_MAX _POSIX_MQ_PRIO_MAX 507 _POSIX_NAME_MAX _POSIX_NGROUPS_MAX 508 _POSIX_OPEN_MAX _POSIX_PATH_MAX 509 _POSIX_PIPE_BUF _POSIX_PRIO_IO 510 _POSIX_RAW_SOCKETS _POSIX_READER_WRITER_LOCKS 511 _POSIX_REGEXP _POSIX_RE_DUP_MAX 512 _POSIX_RTSIG_MAX _POSIX_SAVED_IDS 513 _POSIX_SEM_NSEMS_MAX _POSIX_SEM_VALUE_MAX 514 _POSIX_SHELL _POSIX_SIGQUEUE_MAX 515 _POSIX_SPAWN _POSIX_SPIN_LOCKS 516 _POSIX_SPORADIC_SERVER _POSIX_SSIZE_MAX 517 _POSIX_SS_REPL_MAX _POSIX_STREAM_MAX 518 _POSIX_SYMLINK_MAX _POSIX_SYMLOOP_MAX 519 _POSIX_SYNC_IO _POSIX_THREAD_ATTR_STACKADDR 520 _POSIX_THREAD_ATTR_STACKSIZE _POSIX_THREAD_CPUTIME 521 _POSIX_THREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_KEYS_MAX 522 _POSIX_THREAD_PRIORITY_SCHEDULING _POSIX_THREAD_PRIO_INHERIT 523 _POSIX_THREAD_PRIO_PROTECT _POSIX_THREAD_PROCESS_SHARED 524 _POSIX_THREAD_SAFE_FUNCTIONS _POSIX_THREAD_SPORADIC_SERVER 525 _POSIX_THREAD_THREADS_MAX _POSIX_TIMEOUTS 526 _POSIX_TIMER_MAX _POSIX_TRA_POSIX_TIMER_MAXCE 527 _POSIX_TIMESTAMP_RESOLUTION 528 _POSIX_TRACE_EVENT_FILTER _POSIX_TRACE_EVENT_NAME_MAX 529 _POSIX_TRACE_INHERIT _POSIX_TRACE_LOG 530 _POSIX_TRACE_NAME_MAX _POSIX_TRACE_SYS_MAX 531 _POSIX_TRACE_USER_EVENT_MAX _POSIX_TTY_NAME_MAX 532 _POSIX_TYPED_MEMORY_OBJECTS _POSIX_TZNAME_MAX 533 _POSIX_VERSION _POSIX_V6_ILP32_OFF32 534 _POSIX_V6_ILP32_OFFBIG _POSIX_V6_LP64_OFF64 535 _POSIX_V6_LPBIG_OFFBIG _V6_ILP32_OFF32 536 _V6_ILP32_OFFBIG _V6_LP64_OFF64 537 _V6_LPBIG_OFFBIG RE_DUP_MAX 538 SCHAR_MAX SCHAR_MIN 539 SHRT_MAX SHRT_MIN 540 SSIZE_MAX STREAM_MAX 541 TMP_MAX TZNAME_MAX 542 UCHAR_MAX UINT_MAX 543 ULONG_MAX USHRT_MAX 544 WORD_BIT XBS5_ILP32_OFF32 545 XBS5_ILP32_OFF32_CFLAGS XBS5_ILP32_OFF32_LDFLAGS 546 XBS5_ILP32_OFF32_LIBS XBS5_ILP32_OFF32_LINTFLAGS 547 XBS5_ILP32_OFFBIG XBS5_ILP32_OFFBIG_CFLAGS 548 XBS5_ILP32_OFFBIG_LDFLAGS XBS5_ILP32_OFFBIG_LIBS 549 XBS5_ILP32_OFFBIG_LINTFLAGS XBS5_LP64_OFF64 550 XBS5_LP64_OFF64_CFLAGS XBS5_LP64_OFF64_LDFLAGS 551 XBS5_LP64_OFF64_LIBS XBS5_LP64_OFF64_LINTFLAGS 552 XBS5_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG_CFLAGS 553 XBS5_LPBIG_OFFBIG_LDFLAGS XBS5_LPBIG_OFFBIG_LIBS 554 XBS5_LPBIG_OFFBIG_LINTFLAGS _XOPEN_CRYPT 555 _XOPEN_ENH_I18N _XOPEN_IOV_MAX 556 _XOPEN_LEGACY _XOPEN_NAME_MAX 557 _XOPEN_PATH_MAX _XOPEN_SHM 558 _XOPEN_STREAMS _XOPEN_VERSION 559 _XOPEN_XCU_VERSION _XOPEN_XPG2 560 _XOPEN_XPG3 _XOPEN_XPG4 561 .TE 562 563 .sp 564 .LP 565 The symbol \fBPATH\fR also is recognized, yielding the same value as the 566 \fBconfstr()\fR name value \fBCS_PATH\fR. 567 .SH USAGE 568 .sp 569 .LP 570 See \fBlargefile\fR(5) for the description of the behavior of 571 \fB/usr/bin/getconf\fR when encountering files greater than or equal to 2 Gbyte 572 ( 2^31 bytes). 573 .SH EXAMPLES 574 .LP 575 \fBExample 1 \fRWriting the Value of a Variable 576 .sp 577 .LP 578 This example illustrates the value of \fB{NGROUPS_MAX}:\fR 579 580 .sp 581 .in +2 582 .nf 583 example% \fBgetconf NGROUPS_MAX\fR 584 .fi 585 .in -2 586 .sp 587 588 .LP 589 \fBExample 2 \fRWriting the Value of a Variable for a Specific Directory 590 .sp 591 .LP 592 This example illustrates the value of \fBNAME_MAX\fR for a specific directory: 593 594 .sp 595 .in +2 596 .nf 597 example% \fBgetconf NAME_MAX /usr\fR 598 .fi 599 .in -2 600 .sp 601 602 .LP 603 \fBExample 3 \fRDealing with Unspecified Results 604 .sp 605 .LP 606 This example shows how to deal more carefully with results that might be 607 unspecified: 608 609 .sp 610 .in +2 611 .nf 612 \fBif value=$(getconf PATH_MAX /usr); then 613 if [ "$value" = "undefined" ]; then 614 echo PATH_MAX in /usr is infinite. 615 else 616 echo PATH_MAX in /usr is $value. 617 fi 618 else 619 echo Error in getconf. 620 fi\fR 621 .fi 622 .in -2 623 624 .sp 625 .LP 626 For example: 627 628 .sp 629 .in +2 630 .nf 631 \fBsysconf(_SC_POSIX_C_BIND);\fR 632 .fi 633 .in -2 634 635 .sp 636 .LP 637 and 638 639 .sp 640 .in +2 641 .nf 642 \fBsystem("getconf POSIX2_C_BIND");\fR 643 .fi 644 .in -2 645 646 .sp 647 .LP 648 in a C program could give different answers. The \fBsysconf\fR call supplies a 649 value that corresponds to the conditions when the program was either compiled 650 or executed, depending on the implementation. The \fBsystem\fR call to 651 \fBgetconf\fR always supplies a value corresponding to conditions when the 652 program is executed. 653 654 .SH ENVIRONMENT VARIABLES 655 .sp 656 .LP 657 See \fBenviron\fR(5) for descriptions of the following environment variables 658 that affect the execution of \fBgetconf\fR: \fBLANG\fR, \fBLC_ALL\fR, 659 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR. 660 .sp 661 .LP 662 The following environment variable is supported by the \fBksh93\fR built-in 663 \fBgetconf\fR command: 664 .sp 665 .ne 2 666 .na 667 \fB\fB_AST_FEATURES\fR\fR 668 .ad 669 .RS 17n 670 Local writable values that are different from the default are stored in the 671 \fB_AST_FEATURES\fR environment variable. The \fB_AST_FEATURES\fR value is a 672 space-separated list of \fIname path value\fR 3-tuples, where \fIname\fR is the 673 system configuration name, \fIpath\fR is the corresponding path, \fB-\fR if no 674 path is applicable, and \fIvalue\fR is the system configuration value. 675 .RE 676 677 .SH EXIT STATUS 678 .sp 679 .LP 680 The following exit values are returned: 681 .sp 682 .ne 2 683 .na 684 \fB\fB0\fR\fR 685 .ad 686 .RS 6n 687 The specified variable is valid and information about its current state was 688 written successfully. 689 .RE 690 691 .sp 692 .ne 2 693 .na 694 \fB\fB>0\fR\fR 695 .ad 696 .RS 6n 697 An error occurred. 698 .RE 699 700 .SH ATTRIBUTES 701 .sp 702 .LP 703 See \fBattributes\fR(5) for descriptions of the following attributes: 704 .SS "/usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf" 705 .sp 706 707 .sp 708 .TS 709 box; 710 c | c 711 l | l . 712 ATTRIBUTE TYPE ATTRIBUTE VALUE 713 _ 714 Interface Stability Committed 715 _ 716 Standard See \fBstandards\fR(5). 717 .TE 718 719 .SS "ksh93" 720 .sp 721 722 .sp 723 .TS 724 box; 725 c | c 726 l | l . 727 ATTRIBUTE TYPE ATTRIBUTE VALUE 728 _ 729 Interface Stability See below. 730 .TE 731 732 .sp 733 .LP 734 The \fBksh93\fR built-in binding to \fB/bin\fR and \fB/usr/bin\fR is Volatile. 735 The built-in command-line interface is Committed. 736 .SH SEE ALSO 737 .sp 738 .LP 739 \fBksh93\fR(1), \fBsh\fR(1), \fBpathconf\fR(2), \fBsysinfo\fR(2), 740 \fBconfstr\fR(3C), \fBsysconf\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5), 741 \fBlargefile\fR(5), \fBstandards\fR(5)