1confstr(3C)              Standard C Library Functions              confstr(3C)
2
3
4

NAME

6       confstr - get configurable variables
7

SYNOPSIS

9       #include <unistd.h>
10
11       size_t confstr(int name, char *buf, size_t len);
12
13

DESCRIPTION

15       The  confstr()  function provides a method for applications to get con‐
16       figuration-defined string values.  Its use and purpose are  similar  to
17       the  sysconf(3C)  function,  but  it is used where string values rather
18       than numeric values are returned.
19
20
21       The name argument represents the system variable to be queried.
22
23
24       If len is not 0, and if name has a configuration-defined  value,  conf‐
25       str() copies that value into the  len-byte buffer pointed to by buf. If
26       the string to be returned is longer than len bytes, including the  ter‐
27       minating  null, then confstr() truncates the string to  len−1 bytes and
28       null-terminates the result. The application can detect that the  string
29       was truncated by comparing the value returned by confstr() with len.
30
31
32       If  len  is  0,  confstr()  still  returns the integer value as defined
33       below, but does not return the string.
34
35
36       The confstr() function supports the following values for name,  defined
37       in <unistd.h>, for both SPARC and x86:
38
39       _CS_LFS64_CFLAGS
40
41           If _LFS64_LARGEFILE is defined in <unistd.h>, this value is the set
42           of initial options to be given to the cc and c89 utilities to build
43           an application using the Large File Summit transitional compilation
44           environment (see lfcompile64(5)).
45
46
47       _CS_LFS64_LDFLAGS
48
49           If _LFS64_LARGEFILE is defined in <unistd.h>, this value is the set
50           of  final  options to be given to the cc and c89 utilities to build
51           an application using the Large File Summit transitional compilation
52           environment (see lfcompile64(5)).
53
54
55       _CS_LFS64_LIBS
56
57           If _LFS64_LARGEFILE is defined in <unistd.h>, this value is the set
58           of libraries to be given to the cc and c89 utilities  to  build  an
59           application  using  the  Large File Summit transitional compilation
60           environment (see lfcompile64(5)).
61
62
63       _CS_LFS64_LINTFLAGS
64
65           If _LFS64_LARGEFILE is defined in <unistd.h>, this value is the set
66           of  options  to  be  given to the lint utility to check application
67           source using the Large File Summit transitional  compilation  envi‐
68           ronment (see lfcompile64(5)).
69
70
71       _CS_LFS_CFLAGS
72
73           If  _LFS_LARGEFILE  is defined in <unistd.h>, this value is the set
74           of initial options to be given to the cc and c89 utilities to build
75           an  application  using the Large File Summit large file compilation
76           environment for 32-bit applications (see lfcompile(5)).
77
78
79       _CS_LFS_LDFLAGS
80
81           If _LFS_LARGEFILE is defined in <unistd.h>, this value is  the  set
82           of  final  options to be given to the cc and c89 utilities to build
83           an application using the Large File Summit large  file  compilation
84           environment for 32-bit applications (see lfcompile(5)).
85
86
87       _CS_LFS_LIBS
88
89           If  _LFS_LARGEFILE  is defined in <unistd.h>, this value is the set
90           of libraries to be given to the cc and c89 utilities  to  build  an
91           application  using  the  Large  File  Summit large file compilation
92           environment for 32-bit applications (see lfcompile(5)).
93
94
95       _CS_LFS_LINTFLAGS
96
97           If _LFS_LARGEFILE is defined in <unistd.h>, this value is  the  set
98           of  options  to  be  given to the lint utility to check application
99           source using the Large File Summit large file compilation  environ‐
100           ment for 32-bit applications (see lfcompile(5)).
101
102
103       _CS_PATH
104
105           If the ISO POSIX.2 standard is supported, this is the value for the
106           PATH environment variable that finds all standard utilities.   Oth‐
107           erwise the meaning of this value is unspecified.
108
109
110       _CS_POSIX_V6_ILP32_OFF32_CFLAGS
111
112           If  sysconf(_SC_V6_ILP32_OFF32)  returns  -1,  the  meaning of this
113           value is unspecified.  Otherwise, this value is the set of  initial
114           options  to  be  given  to  the c99 utility to build an application
115           using a programming model with 32-bit int, long, pointer, and off_t
116           types.
117
118
119       _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
120
121           If  sysconf(_SC_V6_ILP32_OFF32)  returns  -1,  the  meaning of this
122           value is unspecified. Otherwise, this value is  the  set  of  final
123           options  to  be  given  to  the c99 utility to build an application
124           using a programming model with 32-bit int, long, pointer, and off_t
125           types.
126
127
128       _CS_POSIX_V6_ILP32_OFF32_LIBS
129
130           If  sysconf(_SC_V6_ILP32_OFF32)  returns  -1,  the  meaning of this
131           value is unspecified. Otherwise, this value is the set of libraries
132           to be given to the c99 utility to build an application using a pro‐
133           gramming model with 32-bit int, long, pointer, and off_t types.
134
135
136       _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
137
138            If sysconf(_SC_V6_ILP32_OFFBIG) returns -1, the  meaning  of  this
139           value  is  unspecified. Otherwise, this value is the set of initial
140           options to be given to the c99  utility  to  build  an  application
141           using a programming model with 32-bit int, long, and pointer types,
142           and an off_t type using at least 64 bits.
143
144
145       _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
146
147           If sysconf(_SC_V6_ILP32_OFFBIG) returns -1,  the  meaning  of  this
148           value  is  unspecified.  Otherwise,  this value is the set of final
149           options to be given to the c99  utility  to  build  an  application
150           using a programming model with 32-bit int, long, and pointer types,
151           and an off_t type using at least 64 bits.
152
153
154       _CS_POSIX_V6_ILP32_OFFBIG_LIBS
155
156           If sysconf(_SC_V6_ILP32_OFFBIG) returns -1,  the  meaning  of  this
157           value is unspecified. Otherwise, this value is the set of libraries
158           to be given to the c99 utility to build an application using a pro‐
159           gramming  model  with  32-bit  int, long, and pointer types, and an
160           off_t type using at least 64 bits.
161
162
163       _CS_POSIX_V6_LP64_OFF64_CFLAGS
164
165           If sysconf(_SC_V6_LP64_OFF64) returns -1, the meaning of this value
166           is unspecified. Otherwise, this value is the set of initial options
167           to be given to the c99 utility to build an application using a pro‐
168           gramming model with 64-bit int, long, pointer, and off_t types.
169
170
171       _CS_POSIX_V6_LP64_OFF64_LDFLAGS
172
173           If sysconf(_SC_V6_LP64_OFF64) returns -1, the meaning of this value
174           is unspecified. Otherwise, this value is the set of  final  options
175           to be given to the c99 utility to build an application using a pro‐
176           gramming model with 64-bit int, long, pointer, and off_t types.
177
178
179       _CS_POSIX_V6_LP64_OFF64_LIBS
180
181           If sysconf(_SC_V6_LP64_OFF64) returns -1, the meaning of this value
182           is unspecified. Otherwise, this value is the set of libraries to be
183           given to the c99 utility to build an application using  a  program‐
184           ming model with 64-bit int, long, pointer, and off_t types.
185
186
187       _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
188
189           If  sysconf(_SC_V6_LPBIG_OFFBIG)  returns  -1,  the meaning of this
190           value is unspecified. Otherwise, this value is the set  of  initial
191           options  to  be  given  to  the c99 utility to build an application
192           using a programming model with an int type using at least  32  bits
193           and long, pointer, and off_t types using at least 64 bits.
194
195
196       _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
197
198           If  sysconf(_SC_V6_LPBIG_OFFBIG)  returns  -1,  the meaning of this
199           value is unspecified. Otherwise, this value is  the  set  of  final
200           options  to  be  given  to  the c99 utility to build an application
201           using a programming model with an int type using at least  32  bits
202           and long, pointer, and off_t types using at least 64 bits.
203
204
205       _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
206
207           If  sysconf(_SC_V6_LPBIG_OFFBIG)  returns  -1,  the meaning of this
208           value is unspecified. Otherwise, this value is the set of libraries
209           to be given to the c99 utility to build an application using a pro‐
210           gramming model with an int type using at least 32  bits  and  long,
211           pointer, and off_t types using at least 64 bits.
212
213
214       _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
215
216           This  value  is  a <newline>-separated list of names of programming
217           environments supported  by the implementation in which  the  widths
218           of  the  blksize_t, cc_t, mode_t, nfds_t, pid_t, ptrdiff_t, size_t,
219           speed_t, ssize_t, suseconds_t, tcflag_t, useconds_t,  wchar_t,  and
220           wint_t types are no greater than the width of type long.
221
222
223       _CS_XBS5_ILP32_OFF32_CFLAGS
224
225           If  sysconf(_SC_XBS5_ILP32_OFF32)  returns  −1  the meaning of this
226           value is unspecified.  Otherwise, this value is the set of  initial
227           options  to be given to the cc and c89 utilities to build an appli‐
228           cation using a programming model with 32-bit  int,  long,  pointer,
229           and off_t types.
230
231
232       _CS_XBS5_ILP32_OFF32_LDFLAGS
233
234           If  sysconf(_SC_XBS5_ILP32_OFF32)  returns  −1  the meaning of this
235           value is unspecified.  Otherwise, this value is the  set  of  final
236           options  to be given to the cc and c89 utilities to build an appli‐
237           cation using a programming model with 32-bit  int,  long,  pointer,
238           and off_t types.
239
240
241       _CS_XBS5_ILP32_OFF32_LIBS
242
243           If  sysconf(_SC_XBS5_ILP32_OFF32)  returns  −1  the meaning of this
244           value  is  unspecified.   Otherwise,  this  value  is  the  set  of
245           libraries  to  be  given  to  the  cc and c89 utilities to build an
246           application using  a  programming  model  with  32-bit  int,  long,
247           pointer, and off_t types.
248
249
250       _CS_XBS5_ILP32_OFF32_LINTFLAGS
251
252           If  sysconf(_SC_XBS5_ILP32_OFF32)  returns  −1  the meaning of this
253           value is unspecified.  Otherwise, this value is the set of  options
254           to be given to the lint utility to check application source using a
255           programming model with 32-bit int, long, pointer, and off_t types.
256
257
258       _CS_XBS5_ILP32_OFFBIG_CFLAGS
259
260           If sysconf(_SC_XBS5_ILP32_OFFBIG) returns −1 the  meaning  of  this
261           value  is unspecified.  Otherwise, this value is the set of initial
262           options to be given to the cc and c89 utilities to build an  appli‐
263           cation using a programming model with 32-bit int, long, and pointer
264           types, and an off_t type using at least 64 bits.
265
266
267       _CS_XBS5_ILP32_OFFBIG_LDFLAGS
268
269           If sysconf(SC_XBS5_ILP32_OFFBIG) returns −1  the  meaning  of  this
270           value  is  unspecified.   Otherwise, this value is the set of final
271           options to be given to the cc and c89 utilities to build an  appli‐
272           cation using a programming model with 32-bit int, long, and pointer
273           types, and an off_t type using at least 64 bits.
274
275
276       _CS_XBS5_ILP32_OFFBIG_LIBS
277
278           If sysconf(_SC_XBS5_ILP32_OFFBIG) returns −1 the  meaning  of  this
279           value  is  unspecified.   Otherwise,  this  value  is  the  set  of
280           libraries to be given to the cc  and  c89  utilities  to  build  an
281           application  using  a  programming model with 32-bit int, long, and
282           pointer types, and an off_t type using at least 64 bits.
283
284
285       _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
286
287           If sysconf(_SC_XBS5_ILP32_OFFBIG) returns −1 the  meaning  of  this
288           value  is unspecified.  Otherwise, this value is the set of options
289           to be given to the lint utility to check  an  application  using  a
290           programming  model with 32-bit int, long, and pointer types, and an
291           off_t type using at least 64 bits.
292
293
294
295       The confstr() function supports the following values for name,  defined
296       in <unistd.h>, for SPARC only:
297
298       _CS_XBS5_LP64_OFF64_CFLAGS
299
300           If  sysconf(_SC_XBS5_LP64_OFF64)  returns  −1  the  meaning of this
301           value is unspecified.  Otherwise, this value is the set of  initial
302           options  to be given to the cc and c89 utilities to build an appli‐
303           cation using a programming model with 64-bit  int,  long,  pointer,
304           and off_t types.
305
306
307       _CS_XBS5_LP64_OFF64_LDFLAGS
308
309           If  sysconf(_SC_XBS5_LP64_OFF64)  returns  −1  the  meaning of this
310           value is unspecified.  Otherwise, this value is the  set  of  final
311           options  to be given to the cc and c89 utilities to build an appli‐
312           cation using a programming model with 64-bit  int,  long,  pointer,
313           and off_t types.
314
315
316       _CS_XBS5_LP64_OFF64_LIBS
317
318           If  sysconf(_SC_XBS5_LP64_OFF64)  returns  −1  the  meaning of this
319           value  is  unspecified.   Otherwise,  this  value  is  the  set  of
320           libraries  to  be  given  to  the  cc and c89 utilities to build an
321           application using  a  programming  model  with  64-bit  int,  long,
322           pointer, and off_t types.
323
324
325       _CS_XBS5_LP64_OFF64_LINTFLAGS
326
327           If  sysconf(_SC_XBS5_LP64_OFF64)  returns  −1  the  meaning of this
328           value is unspecified.  Otherwise, this value is the set of  options
329           to be given to the lint utility to check application source using a
330           programming model with 64-bit int, long, pointer, and off_t types.
331
332
333       _CS_XBS5_LPBIG_OFFBIG_CFLAGS
334
335           If sysconf(_SC_XBS5_LPBIG_OFFBIG) returns −1 the  meaning  of  this
336           value  is unspecified.  Otherwise, this value is the set of initial
337           options to be given to the cc and c89 utilities to build an  appli‐
338           cation using a programming model with an int type using at least 32
339           bits and long, pointer, and off_t types using at least 64 bits.
340
341
342       _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
343
344           If sysconf(_SC_XBS5_LPBIG_OFFBIG) returns −1 the  meaning  of  this
345           value  is  unspecified.   Otherwise, this value is the set of final
346           options to be given to the cc and c89 utilities to build an  appli‐
347           cation using a programming model with an int type using at least 32
348           bits and long, pointer, and off_t types using at least 64 bits.
349
350
351       _CS_XBS5_LPBIG_OFFBIG_LIBS
352
353           If sysconf(_SC_XBS5_LPBIG_OFFBIG) returns −1 the  meaning  of  this
354           value  is  unspecified.   Otherwise,  this  value  is  the  set  of
355           libraries to be given to the cc  and  c89  utilities  to  build  an
356           application  using  a  programming  model with an int type using at
357           least 32 bits and long, pointer, and off_t types using at least  64
358           bits.
359
360
361       _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
362
363           If  sysconf(_SC_XBS5_LPBIG_OFFBIG)  returns  −1 the meaning of this
364           value is unspecified.  Otherwise, this value is the set of  options
365           to be given to the lint utility to check application source using a
366           programming model with an int type using at least 32 bits and long,
367           pointer, and off_t types using at least 64 bits.
368
369

RETURN VALUES

371       If  name  has  a  configuration-defined  value,  the confstr() function
372       returns the size of buffer that would be needed to hold the entire con‐
373       figuration-defined  value.   If  this return value is greater than len,
374       the string returned in buf is truncated.
375
376
377       If name is invalid, confstr() returns 0 and sets  errno to indicate the
378       error.
379
380
381       If  name does not have a configuration-defined value, confstr() returns
382       0 and leaves errno unchanged.
383

ERRORS

385       The confstr() function will fail if:
386
387       EINVAL    The value of the name argument is invalid.
388
389

ATTRIBUTES

391       See attributes(5) for descriptions of the following attributes:
392
393
394
395
396       ┌─────────────────────────────┬─────────────────────────────┐
397       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
398       ├─────────────────────────────┼─────────────────────────────┤
399       │Interface Stability          │Standard                     │
400       ├─────────────────────────────┼─────────────────────────────┤
401       │MT-Level                     │Mt-Safe                      │
402       └─────────────────────────────┴─────────────────────────────┘
403

SEE ALSO

405       pathconf(2), sysconf(3C), attributes(5), lfcompile(5),  lfcompile64(5),
406       standards(5)
407
408
409
410SunOS 5.11                        15 Dec 2003                      confstr(3C)
Impressum