3 .\" The DragonFly Project. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in
13 .\" the documentation and/or other materials provided with the
15 .\" 3. Neither the name of The DragonFly Project nor the names of its
16 .\" contributors may be used to endorse or promote products derived
17 .\" from this software without specific, prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" $DragonFly: src/lib/libc/sys/varsym.2,v 1.3 2008/02/24 19:46:47 swildner Exp $
41 .Nd variant symlink variables
48 .Fn varsym_get "int mask" "const char *wild" "char *buf" "int bufsize"
50 .Fn varsym_set "int level" "const char *name" "const char *data"
52 .Fn varsym_list "int level" "char *buf" "int maxsize" "int *marker"
56 system call retrieves the value of the first variable whose left side matches
58 and return the value in
61 specifies the length of the buffer and
63 can be used to further restrict the search to variables of certain type.
66 will search all variables (see below for other mask definitions).
73 to the value pointed to by
78 system call fills the buffer
80 with variable settings for the specified
84 bytes of settings are returned and
86 is set to the actual number of name/value pairs read, or -1 if no more
89 must be called repeatedly until
91 is -1 if all settings are to be retrieved.
92 The format of the buffer is
93 .Dq \e000name\e000value\e000name\e000value... .
97 levels (and masks) are defined in
99 .Bl -tag -width indent
100 .It Dv VARSYM_PROC Pq Dv VARSYM_PROC_MASK
101 Per-process variables.
102 .\".It Dv VARSYM_USER Pq Dv VARSYM_USER_MASK
103 .\"Per-user variables.
104 .It Dv VARSYM_SYS Pq Dv VARSYM_SYS_MASK
105 System wide variables.
110 .Rv -std varsym_get varsym_set
114 function returns the number of bytes read if successful;
115 otherwise the value -1 is returned and the global variable
117 is set to indicate the error.
121 system calls will fail when one of the following occurs:
128 A variable could not be found.
130 Insufficient space for storing variable values was specified.
137 system calls first appeared in
143 system calls were written by
145 and this manual page was written by