Penguin
Annotated edit history of confstr(3) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 CONFSTR
2 !!!CONFSTR
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 RETURN VALUE
7 EXAMPLES
8 ERRORS
9 CONFORMING TO
10 BUGS
11 SEE ALSO
12 ----
13 !!NAME
14
15
16 confstr - get configuration dependent string variables
17 !!SYNOPSIS
18
19
20 __#define _POSIX_C_SOURCE 2
21 __or
22 __#define _XOPEN_SOURCE
23 #include
24 __ ''name''__, char *__''buf''__, size_t__ ''len''__);
25 __
26 !!DESCRIPTION
27
28
29 __confstr()__ gets the value of configuration - dependent
30 string variables.
31
32
33 The ''name'' argument is the system variable to be
34 queried. The following variables are supported:
35
36
37 ___CS_PATH__
38
39
40 A value for the __PATH__ variable which indicates where
41 all the POSIX.2 standard utilities can be
42 found.
43
44
45 If ''buf'' is not __NULL__, and ''len'' is not
46 zero, __confstr()__ copies the value of the string to
47 ''buf'' truncated to ''len - 1'' characters if
48 necessary, with a null character as termination. This can be
49 detected by comparing the return value of __confstr()__
50 against ''len''.
51
52
53 If ''len'' is zero and ''buf'' is __NULL__,
54 __confstr()__ just returns the value as defined
55 below.
56 !!RETURN VALUE
57
58
59 If ''name'' does not correspond to a valid configuration
60 variable, __confstr()__ returns 0.
61 !!EXAMPLES
62
63
64 The following code fragment determines the path where to
65 find the POSIX.2 system utilities:
66
67
68 char *pathbuf; size_t n;
69 n = confstr(_CS_PATH,NULL,(size_t)0);
70 if ((pathbuf = malloc(n)) == NULL) abort();
71 confstr(_CS_PATH, pathbuf, n);
72 !!ERRORS
73
74
75 If the value of ''name'' is invalid, ''errno'' is set
76 to __EINVAL__.
77 !!CONFORMING TO
78
79
80 proposed POSIX.2
81 !!BUGS
82
83
84 POSIX.2 is not yet an approved standard; the information in
85 this manpage is subject to change.
86 !!SEE ALSO
87
88
89 sh(1), exec(3), system(3)
90 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.