[832e33c] | 1 | @c |
---|
[6449498] | 2 | @c COPYRIGHT (c) 1988-2002. |
---|
[832e33c] | 3 | @c On-Line Applications Research Corporation (OAR). |
---|
| 4 | @c All rights reserved. |
---|
| 5 | @c |
---|
| 6 | @c $Id$ |
---|
| 7 | @c |
---|
| 8 | |
---|
| 9 | @chapter Configuration Space Manager |
---|
| 10 | |
---|
| 11 | @section Introduction |
---|
| 12 | |
---|
[d1a859c] | 13 | The configuration space manager provides a portable |
---|
| 14 | interface for manipulating configuration data. |
---|
| 15 | The capabilities in this manager were defined in the POSIX |
---|
| 16 | 1003.1h/D3 proposed standard titled @b{Services for Reliable, |
---|
| 17 | Available, and Serviceable Systems}. |
---|
[832e33c] | 18 | |
---|
| 19 | The directives provided by the configuration space manager are: |
---|
| 20 | |
---|
| 21 | @itemize @bullet |
---|
[16bed8a] | 22 | @item @code{cfg_mount} - Mount a Configuration Space |
---|
[e6bfa70] | 23 | @item @code{cfg_unmount} - Unmount a Configuration Space |
---|
| 24 | @item @code{cfg_mknod} - Create a Configuration Node |
---|
| 25 | @item @code{cfg_get} - Get Configuration Node Value |
---|
| 26 | @item @code{cfg_set} - Set Configuration Node Value |
---|
| 27 | @item @code{cfg_link} - Create a Configuration Link |
---|
| 28 | @item @code{cfg_unlink} - Remove a Configuration Link |
---|
| 29 | @item @code{cfg_open} - Open a Configuration Space |
---|
| 30 | @item @code{cfg_read} - Read a Configuration Space |
---|
| 31 | @item @code{cfg_children} - Get Node Entries |
---|
| 32 | @item @code{cfg_mark} - Set Configuration Space Option |
---|
[433c5585] | 33 | @item @code{cfg_readdir} - Reads a directory |
---|
| 34 | @item @code{cfg_umask} - Sets a file creation mask |
---|
| 35 | @item @code{cfg_chmod} - Changes file mode |
---|
[6385cbd] | 36 | @item @code{cfg_chown} - Changes the owner and/or group of a file |
---|
[832e33c] | 37 | @end itemize |
---|
| 38 | |
---|
| 39 | @section Background |
---|
| 40 | |
---|
[571a915] | 41 | @subsection Configuration Nodes |
---|
| 42 | |
---|
| 43 | @subsection Configuration Space |
---|
| 44 | |
---|
[c7cb6bbb] | 45 | @subsection Format of a Configuration Space File |
---|
| 46 | |
---|
[832e33c] | 47 | @section Operations |
---|
| 48 | |
---|
[571a915] | 49 | @subsection Mount and Unmounting |
---|
| 50 | |
---|
| 51 | @subsection Creating a Configuration Node |
---|
| 52 | |
---|
| 53 | @subsection Removing a Configuration Node |
---|
| 54 | |
---|
| 55 | @subsection Manipulating a Configuration Node |
---|
| 56 | |
---|
| 57 | @subsection Traversing a Configuration Space |
---|
| 58 | |
---|
[832e33c] | 59 | @section Directives |
---|
| 60 | |
---|
| 61 | This section details the configuration space manager's directives. |
---|
| 62 | A subsection is dedicated to each of this manager's directives |
---|
| 63 | and describes the calling sequence, related constants, usage, |
---|
| 64 | and status codes. |
---|
| 65 | |
---|
| 66 | @page |
---|
[16bed8a] | 67 | @subsection cfg_mount - Mount a Configuration Space |
---|
[832e33c] | 68 | |
---|
| 69 | @subheading CALLING SEQUENCE: |
---|
| 70 | |
---|
| 71 | @ifset is-C |
---|
| 72 | @example |
---|
[3e6eb1dd] | 73 | #include <cfg.h> |
---|
| 74 | |
---|
[832e33c] | 75 | int cfg_mount( |
---|
[16bed8a] | 76 | const char *file, |
---|
| 77 | const char *cfgpath, |
---|
| 78 | log_facility_t notification, |
---|
[832e33c] | 79 | ); |
---|
| 80 | @end example |
---|
| 81 | @end ifset |
---|
| 82 | |
---|
| 83 | @ifset is-Ada |
---|
| 84 | @end ifset |
---|
| 85 | |
---|
| 86 | @subheading STATUS CODES: |
---|
| 87 | |
---|
[8dd54b6] | 88 | A successful call to @code{cfg_mount()} returns a value of zero |
---|
| 89 | and an unsuccessful call returns the @code{errno}. |
---|
| 90 | |
---|
[16bed8a] | 91 | @table @b |
---|
| 92 | @item EPERM |
---|
| 93 | The caller does not have the appropriate privilege. |
---|
[d1a859c] | 94 | |
---|
[e6bfa70] | 95 | @item EACCES |
---|
| 96 | Search permission is denied for a component of the path prefix. |
---|
[d1a859c] | 97 | |
---|
[e6bfa70] | 98 | @item EEXIST |
---|
[8dd54b6] | 99 | The file specified by the @code{file} argument does not exist |
---|
[d1a859c] | 100 | |
---|
[e6bfa70] | 101 | @item ENAMETOOLONG |
---|
[d5ef5bd1] | 102 | A component of a pathname exceeded @code{NAME_MAX} characters, |
---|
| 103 | or an entire path name exceed @code{PATH_MAX} characters while |
---|
| 104 | @code{_POSIX_NO_TRUNC} is in effect. |
---|
[d1a859c] | 105 | |
---|
[e6bfa70] | 106 | @item ENOENT |
---|
[6385cbd] | 107 | A component of @code{cfgpath} does not exist. |
---|
[d1a859c] | 108 | |
---|
[e6bfa70] | 109 | @item ENOTDIR |
---|
[8dd54b6] | 110 | A component of the @code{file} path prefix is not a directory. |
---|
[d1a859c] | 111 | |
---|
[e6bfa70] | 112 | @item EBUSY |
---|
[8dd54b6] | 113 | The configuration space defined by @code{file} is already mounted. |
---|
[d1a859c] | 114 | |
---|
[e6bfa70] | 115 | @item EINVAL |
---|
| 116 | The notification argument specifies an invalid log facility. |
---|
[16bed8a] | 117 | |
---|
| 118 | @end table |
---|
| 119 | |
---|
[832e33c] | 120 | @subheading DESCRIPTION: |
---|
[df8d3601] | 121 | |
---|
[6385cbd] | 122 | The @code{cfg_mount()} function maps a configuration space defined |
---|
[d1a859c] | 123 | by the file identified by the the @code{file} argument. The |
---|
[6c455f37] | 124 | distinguished node of the mapped configuration space is |
---|
[a99ea16] | 125 | mounted in the active space at the point identified by the |
---|
[d1a859c] | 126 | @code{cfgpath} configuration pathname. |
---|
| 127 | |
---|
| 128 | The @code{notification} argument specifies how changes to the |
---|
[6c455f37] | 129 | mapped configuration space are communicated to the application. |
---|
| 130 | If the @code{notification} argument is NULL, no notification will be |
---|
[d1a859c] | 131 | be performed for the mapped configuration space. If the Event |
---|
| 132 | Logging option is defined, the notification argument defines the |
---|
[6c455f37] | 133 | facility to which changes in the mapped configuration space are |
---|
| 134 | logged. Otherwise, the @code{notification} argument specifies |
---|
| 135 | an implementation defined method of notifying the application |
---|
[d1a859c] | 136 | of changes to the mapped configuration space. |
---|
[832e33c] | 137 | |
---|
| 138 | @subheading NOTES: |
---|
| 139 | |
---|
[d1a859c] | 140 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 141 | this service is available. |
---|
| 142 | |
---|
[832e33c] | 143 | @page |
---|
[e6bfa70] | 144 | @subsection cfg_unmount - Unmount a Configuration Space |
---|
[832e33c] | 145 | |
---|
| 146 | @subheading CALLING SEQUENCE: |
---|
| 147 | |
---|
| 148 | @ifset is-C |
---|
| 149 | @example |
---|
[3e6eb1dd] | 150 | #include <cfg.h> |
---|
| 151 | |
---|
[832e33c] | 152 | int cfg_unmount( |
---|
[e6bfa70] | 153 | const char *cfgpath |
---|
[832e33c] | 154 | ); |
---|
| 155 | @end example |
---|
| 156 | @end ifset |
---|
| 157 | |
---|
| 158 | @ifset is-Ada |
---|
| 159 | @end ifset |
---|
| 160 | |
---|
| 161 | @subheading STATUS CODES: |
---|
| 162 | |
---|
[8dd54b6] | 163 | A successful call to @code{cfg_umount()} returns a value of zero |
---|
| 164 | and an unsuccessful call returns the @code{errno}. |
---|
| 165 | |
---|
[16bed8a] | 166 | @table @b |
---|
[e6bfa70] | 167 | @item EPERM |
---|
| 168 | The caller does not have the appropriate privileges. |
---|
[d1a859c] | 169 | |
---|
[e6bfa70] | 170 | @item EACCES |
---|
| 171 | Search permission is denied for a component of the path prefix. |
---|
[d1a859c] | 172 | |
---|
[e6bfa70] | 173 | @item ENOENT |
---|
[8dd54b6] | 174 | A component of @code{cfgpath} does not exist. |
---|
[d1a859c] | 175 | |
---|
[e6bfa70] | 176 | @item ENAMETOOLONG |
---|
[d5ef5bd1] | 177 | A component of a pathname exceeded @code{NAME_MAX} characters, |
---|
| 178 | or an entire path name exceed @code{PATH_MAX} characters while |
---|
| 179 | @code{_POSIX_NO_TRUNC} is in effect. |
---|
[d1a859c] | 180 | |
---|
[e6bfa70] | 181 | @item EINVAL |
---|
| 182 | The requested node is not the distinguished node of a mounted |
---|
| 183 | configuration space. |
---|
[d1a859c] | 184 | |
---|
[e6bfa70] | 185 | @item EBUSY |
---|
| 186 | One or more processes has an open configuration traversal |
---|
| 187 | stream for the configuration space whose distinguished node is |
---|
| 188 | referenced by the cfgpath argument. |
---|
[d1a859c] | 189 | |
---|
[e6bfa70] | 190 | @item ELOOP |
---|
| 191 | A node appears more than once in the path specified by the |
---|
[8dd54b6] | 192 | @code{cfgpath} argument |
---|
[d1a859c] | 193 | |
---|
[e6bfa70] | 194 | @item ELOOP |
---|
[d5ef5bd1] | 195 | More than @code{SYMLOOP_MAX} symbolic links were encountered during |
---|
[e6bfa70] | 196 | resolution of the cfgpath argument |
---|
[16bed8a] | 197 | |
---|
| 198 | @end table |
---|
| 199 | |
---|
[832e33c] | 200 | @subheading DESCRIPTION: |
---|
| 201 | |
---|
[6385cbd] | 202 | The @code{cfg_umount()} function unmaps the configuration space whose |
---|
[d1a859c] | 203 | distinguished node is mapped in the active space at the location defined |
---|
[a99ea16] | 204 | by @code{cfgpath} configuration pathname. All system resources |
---|
[d1a859c] | 205 | allocated for this configuration space should be deallocated. |
---|
[e6bfa70] | 206 | |
---|
[832e33c] | 207 | @subheading NOTES: |
---|
| 208 | |
---|
[d1a859c] | 209 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 210 | this service is available. |
---|
| 211 | |
---|
[832e33c] | 212 | @page |
---|
[a99ea16] | 213 | @subsection cfg_mknod - Create a Configuration Node |
---|
[832e33c] | 214 | |
---|
| 215 | @subheading CALLING SEQUENCE: |
---|
| 216 | |
---|
| 217 | @ifset is-C |
---|
| 218 | @example |
---|
[3e6eb1dd] | 219 | #include <cfg.h> |
---|
| 220 | |
---|
[832e33c] | 221 | int cfg_mknod( |
---|
[e6bfa70] | 222 | const char *cfgpath, |
---|
| 223 | mode_t mode, |
---|
| 224 | cfg_type_t type |
---|
[832e33c] | 225 | ); |
---|
| 226 | @end example |
---|
| 227 | @end ifset |
---|
| 228 | |
---|
| 229 | @ifset is-Ada |
---|
| 230 | @end ifset |
---|
| 231 | |
---|
| 232 | @subheading STATUS CODES: |
---|
| 233 | |
---|
[8dd54b6] | 234 | A successful call to @code{cfg_mknod()} returns a value of zero |
---|
| 235 | and an unsuccessful call returns the @code{errno}. |
---|
| 236 | |
---|
[16bed8a] | 237 | @table @b |
---|
[e6bfa70] | 238 | @item ENAMETOOLONG |
---|
[d5ef5bd1] | 239 | A component of a pathname exceeded @code{NAME_MAX} characters, |
---|
| 240 | or an entire path name exceed @code{PATH_MAX} characters while |
---|
| 241 | @code{_POSIX_NO_TRUNC} is in effect. |
---|
[d1a859c] | 242 | |
---|
[e6bfa70] | 243 | @item ENOENT |
---|
[a99ea16] | 244 | A component of the path prefix does not exist. |
---|
[d1a859c] | 245 | |
---|
[e6bfa70] | 246 | @item EACCES |
---|
| 247 | Search permission is denied for a component of the path prefix. |
---|
[d1a859c] | 248 | |
---|
| 249 | |
---|
[e6bfa70] | 250 | @item EPERM |
---|
| 251 | The calling process does not have the appropriate privilege. |
---|
[d1a859c] | 252 | |
---|
[e6bfa70] | 253 | @item EEXIST |
---|
| 254 | The named node exists. |
---|
[d1a859c] | 255 | |
---|
[e6bfa70] | 256 | @item EINVAL |
---|
[6385cbd] | 257 | The value of @code{mode} is invalid. |
---|
[d1a859c] | 258 | |
---|
[e6bfa70] | 259 | @item EINVAL |
---|
[6385cbd] | 260 | The value of @code{type} is invalid. |
---|
[d1a859c] | 261 | |
---|
[e6bfa70] | 262 | @item ELOOP |
---|
| 263 | A node appears more than once in the path specified by the |
---|
[8dd54b6] | 264 | @code{cfg_path} argument |
---|
[d1a859c] | 265 | |
---|
[e6bfa70] | 266 | @item ELOOP |
---|
[d5ef5bd1] | 267 | More than @code{SYMLOOP_MAX} symbolic links were encountered during |
---|
[8dd54b6] | 268 | resolution of the @code{cfgpath} argument. |
---|
[d1a859c] | 269 | |
---|
[e6bfa70] | 270 | @item EROFS |
---|
[6385cbd] | 271 | The named @code{node} resides on a read-only configuration space. |
---|
[16bed8a] | 272 | |
---|
| 273 | @end table |
---|
| 274 | |
---|
[832e33c] | 275 | @subheading DESCRIPTION: |
---|
| 276 | |
---|
[6385cbd] | 277 | The @code{cfg_mknod()} function creates a new node in the configuration |
---|
[6c455f37] | 278 | space which contains the pathname prefix of @code{cfgpath}. The node |
---|
| 279 | name is defined by the pathname suffix of @code{cfgpath}. The node |
---|
| 280 | permissions are specified by the value of @code{mode}. The node type |
---|
| 281 | is specified by the value of @code{type}. |
---|
[e6bfa70] | 282 | |
---|
[832e33c] | 283 | @subheading NOTES: |
---|
| 284 | |
---|
[d1a859c] | 285 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 286 | this service is available. |
---|
| 287 | |
---|
[832e33c] | 288 | @page |
---|
[e6bfa70] | 289 | @subsection cfg_get - Get Configuration Node Value |
---|
[832e33c] | 290 | |
---|
| 291 | @subheading CALLING SEQUENCE: |
---|
| 292 | |
---|
| 293 | @ifset is-C |
---|
| 294 | @example |
---|
[3e6eb1dd] | 295 | #include <cfg.h> |
---|
| 296 | |
---|
[832e33c] | 297 | int cfg_get( |
---|
[e6bfa70] | 298 | const char *cfgpath |
---|
| 299 | cfg_value_t *value |
---|
[832e33c] | 300 | ); |
---|
| 301 | @end example |
---|
| 302 | @end ifset |
---|
| 303 | |
---|
| 304 | @ifset is-Ada |
---|
| 305 | @end ifset |
---|
| 306 | |
---|
| 307 | @subheading STATUS CODES: |
---|
| 308 | |
---|
[8dd54b6] | 309 | A successful call to @code{cfg_get()} returns a value of zero |
---|
| 310 | and an unsuccessful call returns the @code{errno}. |
---|
| 311 | |
---|
[16bed8a] | 312 | @table @b |
---|
[e6bfa70] | 313 | @item ENAMETOOLONG |
---|
[d5ef5bd1] | 314 | A component of a pathname exceeded @code{NAME_MAX} characters, |
---|
| 315 | or an entire path name exceed @code{PATH_MAX} characters while |
---|
| 316 | @code{_POSIX_NO_TRUNC} is in effect. |
---|
[d1a859c] | 317 | |
---|
[e6bfa70] | 318 | @item ENOENT |
---|
[8dd54b6] | 319 | A component of @code{cfgpath} does not exist. |
---|
[d1a859c] | 320 | |
---|
[e6bfa70] | 321 | @item EACCES |
---|
| 322 | Search permission is denied for a component of the path prefix. |
---|
[d1a859c] | 323 | |
---|
[e6bfa70] | 324 | @item EPERM |
---|
[a99ea16] | 325 | The calling process does not have the appropriate privileges. |
---|
[d1a859c] | 326 | |
---|
[e6bfa70] | 327 | @item ELOOP |
---|
| 328 | A node appears more than once in the path specified by the |
---|
[8dd54b6] | 329 | @code{cfgpath} argument |
---|
[d1a859c] | 330 | |
---|
[e6bfa70] | 331 | @item ELOOP |
---|
[d5ef5bd1] | 332 | More than @code{SYMLOOP_MAX} symbolic links were encountered during |
---|
[8dd54b6] | 333 | resolution of the @code{cfgpath} argument. |
---|
[16bed8a] | 334 | |
---|
| 335 | @end table |
---|
| 336 | |
---|
[832e33c] | 337 | @subheading DESCRIPTION: |
---|
| 338 | |
---|
[8dd54b6] | 339 | The @code{cfg_get()} function stores the value attribute of the |
---|
[d1a859c] | 340 | configuration node identified by @code{cfgpath}, into the buffer |
---|
| 341 | described by the @code{value} pointer. |
---|
[e6bfa70] | 342 | |
---|
[832e33c] | 343 | @subheading NOTES: |
---|
| 344 | |
---|
[d1a859c] | 345 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 346 | this service is available. |
---|
| 347 | |
---|
[832e33c] | 348 | @page |
---|
[e6bfa70] | 349 | @subsection cfg_set - Set Configuration Node Value |
---|
[832e33c] | 350 | |
---|
| 351 | @subheading CALLING SEQUENCE: |
---|
| 352 | |
---|
| 353 | @ifset is-C |
---|
| 354 | @example |
---|
[3e6eb1dd] | 355 | #include <cfg.h> |
---|
| 356 | |
---|
[832e33c] | 357 | int cfg_set( |
---|
[e6bfa70] | 358 | const char *cfgpath |
---|
| 359 | cfg_value_t *value |
---|
[832e33c] | 360 | ); |
---|
| 361 | @end example |
---|
| 362 | @end ifset |
---|
| 363 | |
---|
| 364 | @ifset is-Ada |
---|
| 365 | @end ifset |
---|
| 366 | |
---|
| 367 | @subheading STATUS CODES: |
---|
| 368 | |
---|
[8dd54b6] | 369 | A successful call to @code{cfg_set()} returns a value of zero |
---|
| 370 | and an unsuccessful call returns the @code{errno}. |
---|
| 371 | |
---|
[16bed8a] | 372 | @table @b |
---|
[e6bfa70] | 373 | @item ENAMETOOLONG |
---|
[d5ef5bd1] | 374 | A component of a pathname exceeded @code{NAME_MAX} characters, |
---|
| 375 | or an entire path name exceed @code{PATH_MAX} characters while |
---|
| 376 | @code{_POSIX_NO_TRUNC} is in effect. |
---|
[d1a859c] | 377 | |
---|
[e6bfa70] | 378 | @item ENOENT |
---|
[8dd54b6] | 379 | A component of @code{cfgpath} does not exist |
---|
[d1a859c] | 380 | |
---|
[e6bfa70] | 381 | @item EACCES |
---|
| 382 | Search permission is denied for a component of the path prefix. |
---|
[d1a859c] | 383 | |
---|
[e6bfa70] | 384 | @item EPERM |
---|
| 385 | The calling process does not have the appropriate privilege. |
---|
[d1a859c] | 386 | |
---|
[e6bfa70] | 387 | @item ELOOP |
---|
| 388 | A node appears more than once in the path specified by the |
---|
[8dd54b6] | 389 | @code{cfgpath} argument. |
---|
[d1a859c] | 390 | |
---|
[e6bfa70] | 391 | @item ELOOP |
---|
[d5ef5bd1] | 392 | More than @code{SYMLOOP_MAX} symbolic links were encountered during |
---|
[e6bfa70] | 393 | resolution of the cfgpath argument. |
---|
[16bed8a] | 394 | |
---|
| 395 | @end table |
---|
| 396 | |
---|
[832e33c] | 397 | @subheading DESCRIPTION: |
---|
| 398 | |
---|
[8dd54b6] | 399 | The @code{cfg_set()} function stores the value specified by the |
---|
[d1a859c] | 400 | @code{value} argument in the configuration node defined by the |
---|
| 401 | @code{cfgpath} argument. |
---|
[e6bfa70] | 402 | |
---|
[832e33c] | 403 | @subheading NOTES: |
---|
| 404 | |
---|
[d1a859c] | 405 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 406 | this service is available. |
---|
| 407 | |
---|
[832e33c] | 408 | @page |
---|
[e6bfa70] | 409 | @subsection cfg_link - Create a Configuration Link |
---|
[832e33c] | 410 | |
---|
| 411 | @subheading CALLING SEQUENCE: |
---|
| 412 | |
---|
| 413 | @ifset is-C |
---|
| 414 | @example |
---|
[3e6eb1dd] | 415 | #include <cfg.h> |
---|
| 416 | |
---|
[832e33c] | 417 | int cfg_link( |
---|
[e6bfa70] | 418 | const char *src |
---|
| 419 | const char *dest |
---|
[832e33c] | 420 | ); |
---|
| 421 | @end example |
---|
| 422 | @end ifset |
---|
| 423 | |
---|
| 424 | @ifset is-Ada |
---|
| 425 | @end ifset |
---|
| 426 | |
---|
| 427 | @subheading STATUS CODES: |
---|
| 428 | |
---|
[8dd54b6] | 429 | A successful call to @code{cfg_link()} returns a value of zero |
---|
| 430 | and an unsuccessful call returns the @code{errno}. |
---|
| 431 | |
---|
[16bed8a] | 432 | @table @b |
---|
[e6bfa70] | 433 | @item ENAMETOOLONG |
---|
[d5ef5bd1] | 434 | A component of a pathname exceeded @code{NAME_MAX} characters, |
---|
| 435 | or an entire path name exceed @code{PATH_MAX} characters while |
---|
| 436 | @code{_POSIX_NO_TRUNC} is in effect. |
---|
[d1a859c] | 437 | |
---|
[e6bfa70] | 438 | @item ENOENT |
---|
| 439 | A component of either path prefix does not exist. |
---|
[d1a859c] | 440 | |
---|
[e6bfa70] | 441 | @item EACCES |
---|
| 442 | A component of either path prefix denies search permission. |
---|
[d1a859c] | 443 | |
---|
[e6bfa70] | 444 | @item EACCES |
---|
| 445 | The requested link requires writing in a node with a mode that |
---|
| 446 | denies write permission. |
---|
[d1a859c] | 447 | |
---|
[e6bfa70] | 448 | @item ENOENT |
---|
[8dd54b6] | 449 | The node named by @code{src} does not exist. |
---|
[d1a859c] | 450 | |
---|
[e6bfa70] | 451 | @item EEXIST |
---|
[8dd54b6] | 452 | The node named by @code{dest} does exist. |
---|
[d1a859c] | 453 | |
---|
[e6bfa70] | 454 | @item EPERM |
---|
| 455 | The calling process does not have the appropriate privilege to |
---|
[8dd54b6] | 456 | modify the node indicated by the @code{src} argument. |
---|
[d1a859c] | 457 | |
---|
[e6bfa70] | 458 | @item EXDEV |
---|
[8dd54b6] | 459 | The link named by @code{dest} and the node named by @code{src} are from different |
---|
[e6bfa70] | 460 | configuration spaces. |
---|
[d1a859c] | 461 | |
---|
[e6bfa70] | 462 | @item ENOSPC |
---|
[a99ea16] | 463 | The node in which the entry for the new link is being placed |
---|
[e6bfa70] | 464 | cannot be extended because there is no space left on the |
---|
| 465 | configuration space containing the node. |
---|
[d1a859c] | 466 | |
---|
[e6bfa70] | 467 | @item EIO |
---|
| 468 | An I/O error occurred while reading from or writing to the |
---|
| 469 | configuration space to make the link entry. |
---|
[d1a859c] | 470 | |
---|
[e6bfa70] | 471 | @item EROFS |
---|
| 472 | The requested link requires writing in a node on a read-only |
---|
| 473 | configuration space. |
---|
[d1a859c] | 474 | |
---|
[16bed8a] | 475 | @end table |
---|
| 476 | |
---|
[832e33c] | 477 | @subheading DESCRIPTION: |
---|
| 478 | |
---|
[8dd54b6] | 479 | The @code{src} and @code{dest} arguments point to pathnames which |
---|
| 480 | name existing nodes. The @code{cfg_link()} function atomically creates |
---|
[6c455f37] | 481 | a link between specified nodes, and increment by one the link count |
---|
| 482 | of the node specified by the @code{src} argument. |
---|
[9886290] | 483 | |
---|
[8dd54b6] | 484 | If the @code{cfg_link()} function fails, no link is created, and the |
---|
[6c455f37] | 485 | link count of the node remains unchanged by this function call. |
---|
[9886290] | 486 | |
---|
[e6bfa70] | 487 | |
---|
[832e33c] | 488 | @subheading NOTES: |
---|
| 489 | |
---|
[d1a859c] | 490 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 491 | this service is available. |
---|
| 492 | |
---|
[832e33c] | 493 | @page |
---|
[e6bfa70] | 494 | @subsection cfg_unlink - Remove a Configuration Link |
---|
[832e33c] | 495 | |
---|
| 496 | @subheading CALLING SEQUENCE: |
---|
| 497 | |
---|
| 498 | @ifset is-C |
---|
| 499 | @example |
---|
[3e6eb1dd] | 500 | #include <cfg.h> |
---|
| 501 | |
---|
[832e33c] | 502 | int cfg_unlink( |
---|
[e6bfa70] | 503 | const char *cfgpath |
---|
[832e33c] | 504 | ); |
---|
| 505 | @end example |
---|
| 506 | @end ifset |
---|
| 507 | |
---|
| 508 | @ifset is-Ada |
---|
| 509 | @end ifset |
---|
| 510 | |
---|
| 511 | @subheading STATUS CODES: |
---|
| 512 | |
---|
[8dd54b6] | 513 | A successful call to @code{cfg_unlink()} returns a value of zero |
---|
| 514 | and an unsuccessful call returns the @code{errno}. |
---|
| 515 | |
---|
[16bed8a] | 516 | @table @b |
---|
[e6bfa70] | 517 | @item ENAMETOOLONG |
---|
[d5ef5bd1] | 518 | A component of a pathname exceeded @code{NAME_MAX} characters, |
---|
| 519 | or an entire path name exceed @code{PATH_MAX} characters. |
---|
[d1a859c] | 520 | |
---|
[e6bfa70] | 521 | @item EACCES |
---|
| 522 | Search permission is denied on the node containing the link to |
---|
| 523 | be removed. |
---|
[d1a859c] | 524 | |
---|
[e6bfa70] | 525 | @item EACCES |
---|
| 526 | Write permission is denied on the node containing the link to |
---|
| 527 | be removed. |
---|
[d1a859c] | 528 | |
---|
[e6bfa70] | 529 | @item ENOENT |
---|
[8dd54b6] | 530 | A component of @code{cfgpath} does not exist. |
---|
[d1a859c] | 531 | |
---|
[e6bfa70] | 532 | @item EPERM |
---|
[a99ea16] | 533 | The calling process does not have the appropriate privilege to |
---|
[8dd54b6] | 534 | modify the node indicated by the path prefix of the @code{cfgpath} |
---|
[e6bfa70] | 535 | argument. |
---|
[d1a859c] | 536 | |
---|
[e6bfa70] | 537 | @item EBUSY |
---|
| 538 | The node to be unlinked is the distinguished node of a mounted |
---|
| 539 | configuration space. |
---|
[d1a859c] | 540 | |
---|
[e6bfa70] | 541 | @item EIO |
---|
| 542 | An I/O error occurred while deleting the link entry or deallocating |
---|
| 543 | the node. |
---|
[d1a859c] | 544 | |
---|
[e6bfa70] | 545 | @item EROFS |
---|
[a99ea16] | 546 | The named node resides in a read-only configuration space. |
---|
[d1a859c] | 547 | |
---|
[e6bfa70] | 548 | @item ELOOP |
---|
| 549 | A node appears more than once in the path specified by the |
---|
[8dd54b6] | 550 | @code{cfgpath} argument. |
---|
[d1a859c] | 551 | |
---|
[e6bfa70] | 552 | @item ELOOP |
---|
[d5ef5bd1] | 553 | More than @code{SYMLOOP_MAX} symbolic links were encountered during |
---|
[e6bfa70] | 554 | resolution of the cfgpath argument. |
---|
[16bed8a] | 555 | |
---|
| 556 | @end table |
---|
| 557 | |
---|
[832e33c] | 558 | @subheading DESCRIPTION: |
---|
| 559 | |
---|
[8dd54b6] | 560 | The @code{cfg_unlink()} function removes the link between the node |
---|
[d1a859c] | 561 | specified by the @code{cfgpath} path prefix and the parent node |
---|
[6c455f37] | 562 | specified by @code{cfgpath}, and decrements the link count |
---|
[d1a859c] | 563 | of the @code{cfgpath} node. |
---|
[df8d3601] | 564 | |
---|
[d1a859c] | 565 | When the link count of the node becomes zero, the space occupied |
---|
[6c455f37] | 566 | by the node is freed and the node is no longer be accessible. |
---|
[9886290] | 567 | |
---|
[832e33c] | 568 | @subheading NOTES: |
---|
| 569 | |
---|
[d1a859c] | 570 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 571 | this service is available. |
---|
| 572 | |
---|
[832e33c] | 573 | @page |
---|
[e6bfa70] | 574 | @subsection cfg_open - Open a Configuration Space |
---|
[832e33c] | 575 | |
---|
| 576 | @subheading CALLING SEQUENCE: |
---|
| 577 | |
---|
| 578 | @ifset is-C |
---|
| 579 | @example |
---|
[3e6eb1dd] | 580 | #include <cfg.h> |
---|
| 581 | |
---|
[832e33c] | 582 | int cfg_open( |
---|
[e6bfa70] | 583 | const char *pathnames[], |
---|
| 584 | int options, |
---|
| 585 | int (*compar)(const CFGENT **f1, const CFGENT **f2), |
---|
[a99ea16] | 586 | CFG **cfgstream |
---|
[832e33c] | 587 | ); |
---|
| 588 | @end example |
---|
| 589 | @end ifset |
---|
| 590 | |
---|
| 591 | @ifset is-Ada |
---|
| 592 | @end ifset |
---|
| 593 | |
---|
| 594 | @subheading STATUS CODES: |
---|
| 595 | |
---|
[8dd54b6] | 596 | A successful call to @code{cfg_open()} returns a value of zero |
---|
| 597 | and an unsuccessful call returns the @code{errno}. |
---|
| 598 | |
---|
[16bed8a] | 599 | @table @b |
---|
[e6bfa70] | 600 | @item EACCES |
---|
| 601 | Search permission is denied for any component of a pathname. |
---|
[d1a859c] | 602 | |
---|
[e6bfa70] | 603 | @item ELOOP |
---|
| 604 | A loop exists in symbolic links encountered during resolution |
---|
| 605 | of a pathname. |
---|
[d1a859c] | 606 | |
---|
[e6bfa70] | 607 | @item ENAMETOOLONG |
---|
[d5ef5bd1] | 608 | The length of a pathname exceeds @code{PATH_MAX}, or a pathname |
---|
| 609 | component is longer than @code{NAME_MAX} while @code{_POSIX_NO_TRUNC} |
---|
[d1a859c] | 610 | |
---|
[e6bfa70] | 611 | @item ENOENT |
---|
| 612 | The pathname argument is an empty string or the named node |
---|
| 613 | does not exist. |
---|
[d1a859c] | 614 | |
---|
[e6bfa70] | 615 | @item EINVAL |
---|
[8dd54b6] | 616 | Either both or neither of @code{CFG_LOGICAL} and @code{CFG_PHYSICAL} are |
---|
| 617 | specified by the @code{options} argument |
---|
[d1a859c] | 618 | |
---|
[e6bfa70] | 619 | @item ENOMEM |
---|
| 620 | Not enough memory is available to create the necessary structures. |
---|
[d1a859c] | 621 | |
---|
[e6bfa70] | 622 | @item ELOOP |
---|
[d5ef5bd1] | 623 | More than @code{SYMLOOP_MAX} symbolic links were encountered during |
---|
[8dd54b6] | 624 | resolution of the @code{pathnames} argument. |
---|
[d1a859c] | 625 | |
---|
[e6bfa70] | 626 | @item ENAMETOOLONG |
---|
| 627 | As a result of encountering a symbolic link in resolution of the |
---|
[8dd54b6] | 628 | pathname specified by the @code{pathnames} argument, the length of |
---|
[d5ef5bd1] | 629 | the substituted pathname string exceeded @code{PATH_MAX}. |
---|
[16bed8a] | 630 | |
---|
| 631 | @end table |
---|
| 632 | |
---|
[832e33c] | 633 | @subheading DESCRIPTION: |
---|
| 634 | |
---|
[8dd54b6] | 635 | The @code{cfg_open()} function opens a configuration traversal stream |
---|
[d1a859c] | 636 | rooted in the configuration nodes name by the @code{pathnames} argument. |
---|
[6c455f37] | 637 | It stores a pointer to a CFG object that represents that stream at |
---|
[d1a859c] | 638 | the location identified the @code{cfgstream} pointer. The @code{pathnames} |
---|
| 639 | argument is an array of character pointers to NULL-terminated strings. |
---|
[6c455f37] | 640 | The last member of this array is a NULL pointer. |
---|
[d1a859c] | 641 | |
---|
| 642 | The value of @code{options} is the bitwise inclusive OR of values from the |
---|
[6c455f37] | 643 | following lists. Applications supply exactly one of the first two values |
---|
| 644 | below in @code{options}. |
---|
[d1a859c] | 645 | |
---|
| 646 | @table @b |
---|
| 647 | |
---|
| 648 | @item CFG_LOGICAL |
---|
| 649 | When symbolic links referencing existing nodes are |
---|
| 650 | encountered during the traversal, the @code{cfg_info} |
---|
[6c455f37] | 651 | field of the returned CFGENT structure describes the |
---|
| 652 | target node pointed to by the link instead of the |
---|
[d1a859c] | 653 | link itself, unless the target node does not exist. |
---|
| 654 | If the target node has children, the pre-order return, |
---|
[a99ea16] | 655 | followed by the return of structures referencing all of |
---|
[6c455f37] | 656 | its descendants, followed by a post-order return, is done. |
---|
[3f9da79] | 657 | |
---|
[d1a859c] | 658 | @item CFG_PHYSICAL |
---|
| 659 | When symbolic links are encountered during the traversal, |
---|
[6c455f37] | 660 | the @code{cfg_info} field is used to describe the symbolic |
---|
[d1a859c] | 661 | link. |
---|
| 662 | |
---|
| 663 | @end table |
---|
[3f9da79] | 664 | |
---|
[df8d3601] | 665 | |
---|
[d1a859c] | 666 | Any combination of the remaining flags can be specified in the value of |
---|
| 667 | @code{options} |
---|
| 668 | |
---|
| 669 | @table @b |
---|
| 670 | |
---|
| 671 | @item CFG_COMFOLLOW |
---|
| 672 | When symbolic links referencing existing nodes are |
---|
| 673 | specified in the @code{pathnames} argument, the |
---|
| 674 | @code{cfg_info} field of the returned CFGENT structure |
---|
[6c455f37] | 675 | describes the target node pointed to by the link |
---|
[d1a859c] | 676 | instead of the link itself, unless the target node does |
---|
| 677 | not exist. If the target node has children, the |
---|
| 678 | pre-order return, followed by the return of structures |
---|
| 679 | referencing all its descendants, followed by a post-order |
---|
[8dd54b6] | 680 | return, is done. |
---|
[d1a859c] | 681 | |
---|
| 682 | @item CFG_XDEV |
---|
[6c455f37] | 683 | The configuration space functions do not return a |
---|
[d1a859c] | 684 | CFGENT structure for any node in a different configuration |
---|
[a99ea16] | 685 | space than the configuration space of the nodes identified |
---|
[d1a859c] | 686 | by the CFGENT structures for the @code{pathnames} argument. |
---|
| 687 | |
---|
| 688 | @end table |
---|
| 689 | |
---|
[8dd54b6] | 690 | The @code{cfg_open()} argument @code{compar} is either a NULL or point |
---|
[6c455f37] | 691 | to a function that is called with two pointers to pointers to CFGENT |
---|
| 692 | structures that returns less than, equal to , or greater than zero if |
---|
[d1a859c] | 693 | the node referenced by the first argument is considered to be respectively |
---|
| 694 | less than, equal to, or greater than the node referenced by the second. |
---|
[6c455f37] | 695 | The CFGENT structure fields provided to the comparison routine is as |
---|
[d1a859c] | 696 | described with the exception that the contents of the @code{cfg_path} and |
---|
| 697 | @code{cfg_pathlen} fields are unspecified. |
---|
| 698 | |
---|
| 699 | This comparison routine is used to determine the order in which nodes in |
---|
| 700 | directories encountered during the traversal are returned, and the order |
---|
| 701 | of traversal when more than one node is specified in the @code{pathnames} |
---|
[8dd54b6] | 702 | argument to @code{cfg_open()}. If a comparison routine is specified, the |
---|
[6c455f37] | 703 | order of traversal is from the least to the greatest. If the @code{compar} |
---|
[8dd54b6] | 704 | argument is NULL, the order of traversal shall is listed in the |
---|
[6c455f37] | 705 | @code{pathnames} argument. |
---|
[e6bfa70] | 706 | |
---|
[832e33c] | 707 | @subheading NOTES: |
---|
| 708 | |
---|
[d1a859c] | 709 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 710 | this service is available. |
---|
| 711 | |
---|
[832e33c] | 712 | @page |
---|
[e6bfa70] | 713 | @subsection cfg_read - Read a Configuration Space |
---|
[832e33c] | 714 | |
---|
| 715 | @subheading CALLING SEQUENCE: |
---|
| 716 | |
---|
| 717 | @ifset is-C |
---|
| 718 | @example |
---|
[3e6eb1dd] | 719 | #include <cfg.h> |
---|
| 720 | |
---|
[e6bfa70] | 721 | int cfg_read( |
---|
| 722 | CFG *cfgp, |
---|
| 723 | CFGENT **node |
---|
[832e33c] | 724 | ); |
---|
| 725 | @end example |
---|
| 726 | @end ifset |
---|
| 727 | |
---|
| 728 | @ifset is-Ada |
---|
| 729 | @end ifset |
---|
| 730 | |
---|
| 731 | @subheading STATUS CODES: |
---|
| 732 | |
---|
[8dd54b6] | 733 | A successful call to @code{cfg_read()} returns a value of zero |
---|
| 734 | and an unsuccessful call returns the @code{errno}. |
---|
| 735 | |
---|
[16bed8a] | 736 | @table @b |
---|
[e6bfa70] | 737 | @item EACCES |
---|
| 738 | Search permission is denied for any component of a pathname. |
---|
[d1a859c] | 739 | |
---|
[e6bfa70] | 740 | @item EBADF |
---|
[8dd54b6] | 741 | The @code{cfgp} argument does not refer to an open configuration |
---|
[e6bfa70] | 742 | space. |
---|
[d1a859c] | 743 | |
---|
[e6bfa70] | 744 | @item ELOOP |
---|
| 745 | A loop exists in symbolic links encountered during resolution |
---|
| 746 | of a pathname. |
---|
[d1a859c] | 747 | |
---|
[e6bfa70] | 748 | @item ENOENT |
---|
[8dd54b6] | 749 | A named @code{node} does not exist. |
---|
[d1a859c] | 750 | |
---|
[e6bfa70] | 751 | @item ENOMEM |
---|
| 752 | Not enough memory is available to create the necessary structures. |
---|
[d1a859c] | 753 | |
---|
[e6bfa70] | 754 | @item ELOOP |
---|
[d5ef5bd1] | 755 | More than @code{SYMLOOP_MAX} symbolic links were encountered during |
---|
[e6bfa70] | 756 | resolution of the cfgpath argument. |
---|
[d1a859c] | 757 | |
---|
[e6bfa70] | 758 | @item ENAMETOOLONG |
---|
[a99ea16] | 759 | As a result of encountering a symbolic link in resolution of the |
---|
[e6bfa70] | 760 | pathname specified by the pathnames argument, the length of the |
---|
[d5ef5bd1] | 761 | substituted pathname string exceeded @code{PATH_MATH}. |
---|
[16bed8a] | 762 | |
---|
| 763 | @end table |
---|
| 764 | |
---|
[832e33c] | 765 | @subheading DESCRIPTION: |
---|
| 766 | |
---|
[8dd54b6] | 767 | The @code{cfg_read()} function returns a pointer to a CFGENT structure |
---|
[d1a859c] | 768 | representing a node in the configuration space to which @code{cfgp} |
---|
[6c455f37] | 769 | refers. The returned pointer is stored at the location indicated |
---|
| 770 | by the @code{node} argument. |
---|
[d1a859c] | 771 | |
---|
| 772 | The child nodes of each node in the configuration tree is returned |
---|
[8dd54b6] | 773 | by @code{cfg_read()}. If a comparison routine was specified to the |
---|
| 774 | @code{cfg_open()} function, the order of return of the child nodes is |
---|
| 775 | as specified by the @code{compar} routine, from least to greatest. |
---|
| 776 | Otherwise, the order of return is unspecified. |
---|
[d1a859c] | 777 | |
---|
[6c455f37] | 778 | Structures referencing nodes with children is returned by the |
---|
[8dd54b6] | 779 | function @code{cfg_read()} at least twice [unless the application |
---|
| 780 | specifies otherwise with @code{cfg_mark()}]-once immediately before |
---|
[d1a859c] | 781 | the structures representing their descendants, are returned |
---|
| 782 | (pre-order), and once immediately after structures representing all |
---|
| 783 | of their descendants, if any, are returned (post-order). The |
---|
[a99ea16] | 784 | CFGENT structure returned in post-order (with the exception of the |
---|
[6c455f37] | 785 | @code{cfg_info} field) is identical to that returned in pre-order. |
---|
| 786 | Structures referencing nodes of other types is returned at least |
---|
[d1a859c] | 787 | once. |
---|
| 788 | |
---|
[6c455f37] | 789 | The fields of the CFGENT structure contains the following |
---|
[a99ea16] | 790 | information: |
---|
[df8d3601] | 791 | |
---|
[d1a859c] | 792 | @table @b |
---|
[9886290] | 793 | |
---|
[d1a859c] | 794 | @item cfg_parent |
---|
| 795 | A pointer to the structure returned by the |
---|
[8dd54b6] | 796 | @code{cfg_read()} function for the node that contains |
---|
[d1a859c] | 797 | the entry for the current node. A @code{cfg_parent} |
---|
[6c455f37] | 798 | structure is provided for the node(s) specified by |
---|
[8dd54b6] | 799 | the @code{pathnames} argument to the @code{cfg_open()} |
---|
[d1a859c] | 800 | function, but the contents of other than its |
---|
| 801 | @code{cfg_number}, @code{cfg_pointer}, @code{cfg_parent}, |
---|
| 802 | and @code{cfg_parent}, and @code{cfg_level} fields are |
---|
| 803 | unspecified. Its @code{cfg_link} field is unspecified. |
---|
| 804 | |
---|
| 805 | @item cfg_link |
---|
[8dd54b6] | 806 | Upon return from the @code{cfg_children()} function, the |
---|
[d1a859c] | 807 | @code{cfg_link} field points to the next CFGENT structure |
---|
| 808 | in a NULL-terminated linked list of CFGENT structures. |
---|
| 809 | Otherwise, the content of the @code{cfg_link} field is |
---|
| 810 | unspecified. |
---|
| 811 | |
---|
| 812 | @item cfg_cycle |
---|
[8dd54b6] | 813 | If the structure being returned by @code{cfg_read()} |
---|
[d1a859c] | 814 | represents a node that appears in the @code{cfg_parent} |
---|
| 815 | linked list tree, the @code{cfg_cycle} field shall point |
---|
| 816 | to the structure representing that entry from the |
---|
| 817 | @code{cfg_parent} linked list. Otherwise the content of |
---|
| 818 | the @code{cfg_cycle} field is unspecified. |
---|
| 819 | |
---|
| 820 | @item cfg_number |
---|
| 821 | The @code{cfg_number} field is provided for use by the |
---|
[6c455f37] | 822 | application program. It is initialized to zero for |
---|
[8dd54b6] | 823 | each new node returned by the @code{cfg_read()} function, |
---|
[6c455f37] | 824 | but is not further modified by the configuration space |
---|
[d1a859c] | 825 | routines. |
---|
| 826 | |
---|
| 827 | @item cfg_pointer |
---|
| 828 | The @code{cfg_pointer} field is provided for use by the |
---|
[6c455f37] | 829 | application program. It is initialized to NULL for |
---|
[8dd54b6] | 830 | each new node returned by the @code{cfg_read()} function, |
---|
[6c455f37] | 831 | but is not further modified by the configuration |
---|
[d1a859c] | 832 | space routines. |
---|
| 833 | |
---|
| 834 | @item cfg_path |
---|
| 835 | A pathname for the node including and relative to the |
---|
[8dd54b6] | 836 | argument supplied to the @code{cfg_open()} routine for this |
---|
[a99ea16] | 837 | configuration space. This pathname may be longer than |
---|
[6c455f37] | 838 | @code{PATH_MAX} bytes. This pathname is NULL-terminated. |
---|
[d1a859c] | 839 | |
---|
| 840 | @item cfg_name |
---|
| 841 | The nodename of the node. |
---|
| 842 | |
---|
| 843 | @item cfg_pathlen |
---|
| 844 | The length of the string pointed at by the @code{cfg_path} |
---|
[8dd54b6] | 845 | field when returned by @code{cfg_read()}. |
---|
[d1a859c] | 846 | |
---|
| 847 | @item cfg_namelen |
---|
| 848 | The length of the string pointed at by the @code{cfg_name} |
---|
| 849 | field. |
---|
| 850 | |
---|
| 851 | @item cfg_level |
---|
| 852 | The depth of the current entry in the configuration space. |
---|
[a99ea16] | 853 | The @code{cfg_level} field of the @code{cfg_parent} |
---|
[d1a859c] | 854 | structure for each of the node(s) specified in the |
---|
[8dd54b6] | 855 | @code{pathnames} argument to the @code{cfg_open()} function |
---|
[6c455f37] | 856 | is set to 0, and this number is incremented for each |
---|
| 857 | node level descendant. |
---|
[d1a859c] | 858 | |
---|
| 859 | @item cfg_info |
---|
[6c455f37] | 860 | This field contains one of the values listed below. If |
---|
[d1a859c] | 861 | an object can have more than one info value, the first |
---|
[6c455f37] | 862 | appropriate value listed below is returned. |
---|
[d1a859c] | 863 | |
---|
| 864 | @table @b |
---|
| 865 | |
---|
| 866 | @item CFG_D |
---|
| 867 | The structure represents a node with children in |
---|
| 868 | pre-order. |
---|
| 869 | |
---|
| 870 | @item CFG_DC |
---|
| 871 | The structure represents a node that is a parent |
---|
[8dd54b6] | 872 | of the node most recently returned by @code{cfg_read()}. |
---|
[6c455f37] | 873 | The @code{cfg_cycle} field references the structure |
---|
| 874 | previously returned by @code{cfg_read} that is the |
---|
| 875 | same as the returned structure. |
---|
[d1a859c] | 876 | |
---|
| 877 | @item CFG_DEFAULT |
---|
| 878 | The structure represents a node that is not |
---|
| 879 | represented by one of the other node types |
---|
| 880 | |
---|
| 881 | @item CFG_DNR |
---|
| 882 | The structure represents a node, not of type symlink, |
---|
| 883 | that is unreadable. The variable @code{cfg_errno} |
---|
[6c455f37] | 884 | is set to the appropriate value. |
---|
[d1a859c] | 885 | |
---|
| 886 | @item CFG_DP |
---|
| 887 | The structure represents a node with children in |
---|
[6c455f37] | 888 | post-order. This value occurs only if CFG_D |
---|
[d1a859c] | 889 | has previously been returned for this entry. |
---|
| 890 | |
---|
| 891 | @item CFG_ERR |
---|
| 892 | The structure represents a node for which an error has |
---|
[6c455f37] | 893 | occurred. The variable @code{cfg_errno} is set to the |
---|
| 894 | appropriate value. |
---|
[d1a859c] | 895 | |
---|
| 896 | @item CFG_F |
---|
| 897 | The structure represents a node without children. |
---|
| 898 | |
---|
| 899 | @item CFG_SL |
---|
| 900 | The structure represents a node of type symbolic link. |
---|
| 901 | |
---|
| 902 | @item CFG_SLNONET |
---|
| 903 | The structure represents a node of type symbolic link |
---|
| 904 | with a target node for which node characteristic |
---|
| 905 | information cannot be obtained. |
---|
| 906 | |
---|
| 907 | @end table |
---|
| 908 | |
---|
| 909 | @end table |
---|
| 910 | |
---|
[8dd54b6] | 911 | Structures returned by @code{cfg_read()} with a @code{cfg_info} field equal |
---|
[6c455f37] | 912 | to CFG_D is accessible until a subsequent call, on the same |
---|
[8dd54b6] | 913 | configuration traversal stream, to @code{cfg_close()}, or to @code{cfg_read()} |
---|
[d1a859c] | 914 | after they have been returned by the @code{cfg_read} function in |
---|
[8dd54b6] | 915 | post-order. Structures returned by @code{cfg_read()} with an |
---|
[6c455f37] | 916 | @code{cfg_info} field not equal to CFG_D is accessible until a subsequent |
---|
[8dd54b6] | 917 | call, on the same configuration traversal stream, to @code{cfg_close()} |
---|
| 918 | or @code{cfg_read()}. |
---|
[d1a859c] | 919 | |
---|
| 920 | The content of the @code{cfg_path} field is specified only for the |
---|
[8dd54b6] | 921 | structure most recently returned by @code{cfg_read()}. |
---|
[d1a859c] | 922 | |
---|
| 923 | The specified fields in structures in the list representing nodes for |
---|
[8dd54b6] | 924 | which structures have previously been returned by @code{cfg_children()}, |
---|
| 925 | is identical to those returned by @code{cfg_children()}, except that |
---|
[d1a859c] | 926 | the contents of the @code{cfg_path} and @code{cfg_pathlen} fields are |
---|
| 927 | unspecified. |
---|
| 928 | |
---|
| 929 | @subheading NOTES: |
---|
| 930 | |
---|
| 931 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 932 | this service is available. |
---|
[832e33c] | 933 | |
---|
| 934 | @page |
---|
[e6bfa70] | 935 | @subsection cfg_children - Get Node Entries |
---|
[832e33c] | 936 | |
---|
| 937 | @subheading CALLING SEQUENCE: |
---|
| 938 | |
---|
| 939 | @ifset is-C |
---|
| 940 | @example |
---|
[3e6eb1dd] | 941 | #include <cfg.h> |
---|
| 942 | |
---|
[832e33c] | 943 | int cfg_children( |
---|
[e6bfa70] | 944 | CFG *cfgp, |
---|
| 945 | int options, |
---|
| 946 | CFGENT **children |
---|
[832e33c] | 947 | ); |
---|
| 948 | @end example |
---|
| 949 | @end ifset |
---|
| 950 | |
---|
| 951 | @ifset is-Ada |
---|
| 952 | @end ifset |
---|
| 953 | |
---|
| 954 | @subheading STATUS CODES: |
---|
| 955 | |
---|
[8dd54b6] | 956 | A successful call to @code{cfg_children()} returns a value of zero |
---|
| 957 | and an unsuccessful call returns the @code{errno}. |
---|
| 958 | |
---|
[16bed8a] | 959 | @table @b |
---|
[e6bfa70] | 960 | @item EACCES |
---|
| 961 | Search permission is denied for any component of a pathname |
---|
[d1a859c] | 962 | |
---|
[e6bfa70] | 963 | @item EBADF |
---|
[8dd54b6] | 964 | The @code{cfgp} argument does not refer to an open configuration space. |
---|
[d1a859c] | 965 | |
---|
[e6bfa70] | 966 | @item ELOOP |
---|
| 967 | A loop exists in symbolic links encountered during resolution of |
---|
| 968 | a pathname. |
---|
[d1a859c] | 969 | |
---|
[e6bfa70] | 970 | @item ENAMETOOLONG |
---|
[d5ef5bd1] | 971 | The length of a pathname exceeds @code{PATH_MAX}, or a pathname |
---|
| 972 | component is longer than @code{NAME_MAX} while @code{_POSIX_NO_TRUNC} is |
---|
[e6bfa70] | 973 | in effect. |
---|
[d1a859c] | 974 | |
---|
[e6bfa70] | 975 | @item EINVAL |
---|
[8dd54b6] | 976 | The specified value of the @code{options} argument is invalid. |
---|
[d1a859c] | 977 | |
---|
[e6bfa70] | 978 | @item ENOENT |
---|
| 979 | The named node does not exist. |
---|
[d1a859c] | 980 | |
---|
[e6bfa70] | 981 | @item ENOMEM |
---|
| 982 | Not enough memory is available to create the necessary structures. |
---|
[16bed8a] | 983 | |
---|
| 984 | @end table |
---|
| 985 | |
---|
[832e33c] | 986 | @subheading DESCRIPTION: |
---|
| 987 | |
---|
[8dd54b6] | 988 | The first @code{cfg_children()} call after a @code{cfg_read()} returns |
---|
[6c455f37] | 989 | information about the first node without children under the node |
---|
[8dd54b6] | 990 | returned by @code{cfg_read()}. Subsequent calls to @code{cfg_children()} |
---|
| 991 | without the intervening @code{cfg_read()} shall return information |
---|
[6c455f37] | 992 | about the remaining nodes without children under that same node. |
---|
[df8d3601] | 993 | |
---|
[8dd54b6] | 994 | If @code{cfg_read()} has not yet been called for the configuration |
---|
| 995 | traversal stream represented by @code{cfgp}, @code{cfg_children()} |
---|
[6c455f37] | 996 | returns a pointer to the first entry in a list of the nodes |
---|
[8dd54b6] | 997 | represented by the @code{pathnames} argument to @code{cfg_open()}. |
---|
[df8d3601] | 998 | |
---|
[6c455f37] | 999 | In either case, the list is NULL-terminated, ordered by the |
---|
[d1a859c] | 1000 | user-specified comparison function, if any, and linked through the |
---|
[8dd54b6] | 1001 | @code{cfg_link} field. |
---|
[df8d3601] | 1002 | |
---|
[832e33c] | 1003 | @subheading NOTES: |
---|
| 1004 | |
---|
[d1a859c] | 1005 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 1006 | this service is available. |
---|
| 1007 | |
---|
[832e33c] | 1008 | @page |
---|
[e6bfa70] | 1009 | @subsection cfg_mark - Set Configuration Space Options |
---|
[832e33c] | 1010 | |
---|
| 1011 | @subheading CALLING SEQUENCE: |
---|
| 1012 | |
---|
| 1013 | @ifset is-C |
---|
| 1014 | @example |
---|
[3e6eb1dd] | 1015 | #include <cfg.h> |
---|
| 1016 | |
---|
[832e33c] | 1017 | int cfg_mark( |
---|
[e6bfa70] | 1018 | CFG *cfgp, |
---|
| 1019 | CFGENT *f, |
---|
| 1020 | int options |
---|
[832e33c] | 1021 | ); |
---|
| 1022 | @end example |
---|
| 1023 | @end ifset |
---|
| 1024 | |
---|
| 1025 | @ifset is-Ada |
---|
| 1026 | @end ifset |
---|
| 1027 | |
---|
| 1028 | @subheading STATUS CODES: |
---|
| 1029 | |
---|
[8dd54b6] | 1030 | A successful call to @code{cfg_mark()} returns a value of zero |
---|
| 1031 | and an unsuccessful call returns the @code{errno}. |
---|
| 1032 | |
---|
[16bed8a] | 1033 | @table @b |
---|
[e6bfa70] | 1034 | @item EINVAL |
---|
[8dd54b6] | 1035 | The specified combination of the @code{cfgp} and @code{f} arguments is not |
---|
[e6bfa70] | 1036 | supported by the implementation. |
---|
[d1a859c] | 1037 | |
---|
[e6bfa70] | 1038 | @item EINVAL |
---|
[8dd54b6] | 1039 | The specified value of the @code{options} argument is invalid. |
---|
[16bed8a] | 1040 | |
---|
| 1041 | @end table |
---|
| 1042 | |
---|
[832e33c] | 1043 | @subheading DESCRIPTION: |
---|
| 1044 | |
---|
[8dd54b6] | 1045 | The @code{cfg_mark()} function modifies the subsequent behavior of |
---|
| 1046 | the @code{cfg} functions with regard to the node referenced by the structure |
---|
[d1a859c] | 1047 | pointed to by the argument @code{f} or the configuration space referenced |
---|
| 1048 | by the structure pointed to by the argument @code{cfgp}. |
---|
| 1049 | |
---|
[6c455f37] | 1050 | Exactly one of the @code{f} argument and the @code{cfgp} argument is NULL. |
---|
[d1a859c] | 1051 | |
---|
[6c455f37] | 1052 | The value of the @code{options} argument is exactly one of the flags |
---|
| 1053 | specified in the following list: |
---|
[d1a859c] | 1054 | |
---|
| 1055 | @table @b |
---|
| 1056 | |
---|
| 1057 | @item CFG_AGAIN |
---|
| 1058 | If the @code{cfgp} argument is non-NULL, or the @code{f} |
---|
| 1059 | argument is NULL, or the structure referenced by @code{f} |
---|
[8dd54b6] | 1060 | is not the one most recently returned by @code{cfg_read()}, |
---|
| 1061 | @code{cfg_mark()} returns an error. Otherwise, the next |
---|
| 1062 | call to the @code{cfg_read()} function returns the structure |
---|
[6c455f37] | 1063 | referenced by @code{f} with the @code{cfg_info} field |
---|
| 1064 | reinitialized. Subsequent behavior of the @code{cfg} |
---|
| 1065 | functions are based on the reinitialized value of |
---|
[a99ea16] | 1066 | @code{cfg_info}. |
---|
[d1a859c] | 1067 | |
---|
| 1068 | @item CFG_SKIP |
---|
| 1069 | If the @code{cfgp} argument is non-NULL, or the @code{f} |
---|
| 1070 | argument is NULL, or the structure referenced by @code{f} |
---|
| 1071 | is not one of those specified as accessible, or the structure |
---|
| 1072 | referenced by @code{f} is not for a node of type pre-order |
---|
[8dd54b6] | 1073 | node, @code{cfg_mark()} returns an error. Otherwise, no |
---|
[d1a859c] | 1074 | more structures for the node referenced by @code{f} or its |
---|
[8dd54b6] | 1075 | descendants are returned by the @code{cfg_read()} function. |
---|
[d1a859c] | 1076 | |
---|
| 1077 | @item CFG_FOLLOW |
---|
| 1078 | If the @code{cfgp} argument is non-NULL, or the @code{f} |
---|
| 1079 | argument is NULL, or the structure referenced by @code{f} |
---|
| 1080 | is not one of those specified as accessible, or the structure |
---|
| 1081 | referenced by @code{f} is not for a node of type symbolic link, |
---|
[8dd54b6] | 1082 | @code{cfg_mark()} returns an error. Otherwise, the next |
---|
| 1083 | call to the @code{cfg_read()} function returns the structure |
---|
[d1a859c] | 1084 | referenced by @code{f} with the @code{cfg_info} field reset |
---|
| 1085 | to reflect the target of the symbolic link instead of the |
---|
| 1086 | symbolic link itself. If the target of the link is node with |
---|
| 1087 | children, the pre-order return, followed by the return of |
---|
| 1088 | structures referencing all of its descendants, followed by a |
---|
| 1089 | post-order return, shall be done. |
---|
| 1090 | |
---|
| 1091 | @end table |
---|
| 1092 | |
---|
| 1093 | If the target of the symbolic link does not exist, the fields |
---|
[8dd54b6] | 1094 | of the structure by @code{cfg_read()} shall be unmodified, except |
---|
[d1a859c] | 1095 | that the @code{cfg_info} field shall be reset to @code{CFG_SLNONE}. |
---|
[e6bfa70] | 1096 | |
---|
[832e33c] | 1097 | @subheading NOTES: |
---|
| 1098 | |
---|
[d1a859c] | 1099 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 1100 | this service is available. |
---|
| 1101 | |
---|
[832e33c] | 1102 | @page |
---|
[e6bfa70] | 1103 | @subsection cfg_close - Close a Configuration Space |
---|
[832e33c] | 1104 | |
---|
| 1105 | @subheading CALLING SEQUENCE: |
---|
| 1106 | |
---|
| 1107 | @ifset is-C |
---|
| 1108 | @example |
---|
[3e6eb1dd] | 1109 | #include <cfg.h> |
---|
| 1110 | |
---|
[832e33c] | 1111 | int cfg_close( |
---|
[e6bfa70] | 1112 | CFG *cfgp |
---|
[832e33c] | 1113 | ); |
---|
| 1114 | @end example |
---|
| 1115 | @end ifset |
---|
| 1116 | |
---|
| 1117 | @ifset is-Ada |
---|
| 1118 | @end ifset |
---|
| 1119 | |
---|
| 1120 | @subheading STATUS CODES: |
---|
| 1121 | |
---|
[8dd54b6] | 1122 | A successful call to @code{cfg_close()} returns a value of zero |
---|
| 1123 | and an unsuccessful call returns the @code{errno}. |
---|
| 1124 | |
---|
[16bed8a] | 1125 | @table @b |
---|
[e6bfa70] | 1126 | @item EBADF |
---|
[8dd54b6] | 1127 | The @code{cfgp} argument does not refer to an open configuration space |
---|
[e6bfa70] | 1128 | traversal stream. |
---|
[16bed8a] | 1129 | |
---|
| 1130 | @end table |
---|
| 1131 | |
---|
[832e33c] | 1132 | @subheading DESCRIPTION: |
---|
| 1133 | |
---|
[8dd54b6] | 1134 | The @code{cfg_close()} function closes a configuration space transversal |
---|
[d1a859c] | 1135 | stream represented by the CFG structure pointed at by the @code{cfgp} |
---|
| 1136 | argument. All system resources allocated for this configuration space |
---|
[a99ea16] | 1137 | traversal stream should be deallocated. Upon return, the value of |
---|
[d1a859c] | 1138 | @code{cfgp} need not point to an accessible object of type CFG. |
---|
[e6bfa70] | 1139 | |
---|
[832e33c] | 1140 | @subheading NOTES: |
---|
| 1141 | |
---|
[d1a859c] | 1142 | The @code{_POSIX_CFG} feature flag is defined to indicate |
---|
| 1143 | this service is available. |
---|
[08142b48] | 1144 | |
---|
| 1145 | @page |
---|
[433c5585] | 1146 | @subsection cfg_readdir - Reads a directory |
---|
[08142b48] | 1147 | |
---|
| 1148 | @subheading CALLING SEQUENCE: |
---|
| 1149 | |
---|
| 1150 | @ifset is-C |
---|
| 1151 | @example |
---|
| 1152 | #include <sys/types.h> |
---|
| 1153 | #include <dirent.h> |
---|
| 1154 | |
---|
[433c5585] | 1155 | struct dirent *cfg_readdir( |
---|
[08142b48] | 1156 | DIR *dirp |
---|
| 1157 | ); |
---|
| 1158 | @end example |
---|
| 1159 | @end ifset |
---|
| 1160 | |
---|
| 1161 | @ifset is-Ada |
---|
| 1162 | @end ifset |
---|
| 1163 | |
---|
| 1164 | @subheading STATUS CODES: |
---|
| 1165 | |
---|
| 1166 | @table @b |
---|
| 1167 | @item EBADF |
---|
| 1168 | Invalid file descriptor |
---|
| 1169 | |
---|
| 1170 | @end table |
---|
| 1171 | |
---|
| 1172 | @subheading DESCRIPTION: |
---|
| 1173 | |
---|
[8dd54b6] | 1174 | The @code{cfg_readdir()} function returns a pointer to a structure @code{dirent} |
---|
[08142b48] | 1175 | representing the next directory entry from the directory stream pointed to |
---|
| 1176 | by @code{dirp}. On end-of-file, NULL is returned. |
---|
| 1177 | |
---|
[8dd54b6] | 1178 | The @code{cfg_readdir()} function may (or may not) return entries for . or .. Your |
---|
[08142b48] | 1179 | program should tolerate reading dot and dot-dot but not require them. |
---|
| 1180 | |
---|
[8dd54b6] | 1181 | The data pointed to be @code{cfg_readdir()} may be overwritten by another call to |
---|
| 1182 | @code{readdir()} for the same directory stream. It will not be overwritten by |
---|
[08142b48] | 1183 | a call for another directory. |
---|
| 1184 | |
---|
| 1185 | @subheading NOTES: |
---|
| 1186 | |
---|
[8dd54b6] | 1187 | If @code{ptr} is not a pointer returned by @code{malloc()}, @code{calloc()}, or |
---|
| 1188 | @code{realloc()} or has been deallocated with @code{free()} or @code{realloc()}, |
---|
[08142b48] | 1189 | the results are not portable and are probably disastrous. |
---|
| 1190 | |
---|
[8dd54b6] | 1191 | This function is not defined in the POSIX specification. It is an extension |
---|
| 1192 | provided by this implementation. |
---|
[08142b48] | 1193 | |
---|
| 1194 | @page |
---|
[433c5585] | 1195 | @subsection cfg_umask - Sets a file creation mask. |
---|
[08142b48] | 1196 | |
---|
| 1197 | @subheading CALLING SEQUENCE: |
---|
| 1198 | |
---|
| 1199 | @ifset is-C |
---|
| 1200 | @example |
---|
| 1201 | #include <sys/types.h> |
---|
| 1202 | #include <sys/stat.h> |
---|
| 1203 | |
---|
[433c5585] | 1204 | mode_t cfg_umask( |
---|
[08142b48] | 1205 | mode_t cmask |
---|
| 1206 | ); |
---|
| 1207 | @end example |
---|
| 1208 | @end ifset |
---|
| 1209 | |
---|
| 1210 | @ifset is-Ada |
---|
| 1211 | @end ifset |
---|
| 1212 | |
---|
| 1213 | @subheading STATUS CODES: |
---|
| 1214 | |
---|
| 1215 | @subheading DESCRIPTION: |
---|
| 1216 | |
---|
[8dd54b6] | 1217 | The @code{cfg_umask()} function sets the process node creation mask to @code{cmask}. |
---|
| 1218 | The file creation mask is used during @code{open()}, @code{creat()}, @code{mkdir()}, |
---|
| 1219 | @code{mkfifo()} calls to turn off permission bits in the @code{mode} argument. |
---|
[08142b48] | 1220 | Bit positions that are set in @code{cmask} are cleared in the mode of the |
---|
| 1221 | created file. |
---|
| 1222 | |
---|
[8dd54b6] | 1223 | The file creation mask is inherited across @code{fork()} and @code{exec()} calls. |
---|
[08142b48] | 1224 | This makes it possible to alter the default permission bits of created files. |
---|
| 1225 | |
---|
[8dd54b6] | 1226 | @subheading NOTES: None |
---|
[08142b48] | 1227 | |
---|
| 1228 | The @code{cmask} argument should have only permission bits set. All other |
---|
| 1229 | bits should be zero. |
---|
| 1230 | |
---|
| 1231 | @page |
---|
[433c5585] | 1232 | @subsection cfg_chmod - Changes file mode. |
---|
[08142b48] | 1233 | |
---|
| 1234 | @subheading CALLING SEQUENCE: |
---|
| 1235 | |
---|
| 1236 | @ifset is-C |
---|
| 1237 | @example |
---|
| 1238 | #include <sys/types.h> |
---|
| 1239 | #include <sys/stat.h> |
---|
| 1240 | |
---|
[433c5585] | 1241 | int cfg_chmod( |
---|
[08142b48] | 1242 | const char *path, |
---|
| 1243 | mode_t mode |
---|
| 1244 | ); |
---|
| 1245 | @end example |
---|
| 1246 | @end ifset |
---|
| 1247 | |
---|
| 1248 | @ifset is-Ada |
---|
| 1249 | @end ifset |
---|
| 1250 | |
---|
| 1251 | @subheading STATUS CODES: |
---|
| 1252 | |
---|
[8dd54b6] | 1253 | A successful call to @code{cfg_chmod()} returns a value of zero |
---|
| 1254 | and an unsuccessful call returns the @code{errno}. |
---|
| 1255 | |
---|
[08142b48] | 1256 | @table @b |
---|
| 1257 | @item EACCES |
---|
| 1258 | Search permission is denied for a directory in a file's path prefix |
---|
| 1259 | @item ENAMETOOLONG |
---|
| 1260 | Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in |
---|
| 1261 | effect. |
---|
| 1262 | @item ENOENT |
---|
| 1263 | A file or directory does not exist. |
---|
| 1264 | @item ENOTDIR |
---|
| 1265 | A component of the specified pathname was not a directory when a directory |
---|
| 1266 | was expected. |
---|
| 1267 | @item EPERM |
---|
| 1268 | Operation is not permitted. Process does not have the appropriate priviledges |
---|
| 1269 | or permissions to perform the requested operations. |
---|
| 1270 | @item EROFS |
---|
| 1271 | Read-only file system. |
---|
| 1272 | |
---|
| 1273 | @end table |
---|
| 1274 | |
---|
| 1275 | @subheading DESCRIPTION: |
---|
| 1276 | |
---|
| 1277 | Set the file permission bits, the set user ID bit, and the set group ID bit |
---|
| 1278 | for the file named by @code{path} to @code{mode}. If the effective user ID |
---|
[8dd54b6] | 1279 | does not match the owner of the node and the calling process does not have |
---|
| 1280 | the appropriate privileges, @code{cfg_chmod()} returns -1 and sets @code{errno} to |
---|
[08142b48] | 1281 | @code{EPERM}. |
---|
| 1282 | |
---|
| 1283 | @subheading NOTES: |
---|
| 1284 | |
---|
| 1285 | @page |
---|
[433c5585] | 1286 | @subsection cfg_chown - Changes the owner and/or group of a file. |
---|
[08142b48] | 1287 | |
---|
| 1288 | @subheading CALLING SEQUENCE: |
---|
| 1289 | |
---|
| 1290 | @ifset is-C |
---|
| 1291 | @example |
---|
| 1292 | #include <sys/types.h> |
---|
| 1293 | #include <unistd.h> |
---|
| 1294 | |
---|
[433c5585] | 1295 | int cfg_chown( |
---|
[08142b48] | 1296 | const char *path, |
---|
| 1297 | uid_t owner, |
---|
| 1298 | gid_t group |
---|
| 1299 | ); |
---|
| 1300 | @end example |
---|
| 1301 | @end ifset |
---|
| 1302 | |
---|
| 1303 | @ifset is-Ada |
---|
| 1304 | @end ifset |
---|
| 1305 | |
---|
| 1306 | @subheading STATUS CODES: |
---|
| 1307 | |
---|
[8dd54b6] | 1308 | A successful call to @code{cfg_chown()} returns a value of zero |
---|
| 1309 | and an unsuccessful call returns the @code{errno}. |
---|
| 1310 | |
---|
[08142b48] | 1311 | @table @b |
---|
| 1312 | @item EACCES |
---|
| 1313 | Search permission is denied for a directory in a file's path prefix |
---|
| 1314 | @item EINVAL |
---|
| 1315 | Invalid argument |
---|
| 1316 | @item ENAMETOOLONG |
---|
| 1317 | Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in |
---|
| 1318 | effect. |
---|
| 1319 | @item ENOENT |
---|
| 1320 | A file or directory does not exist. |
---|
| 1321 | @item ENOTDIR |
---|
| 1322 | A component of the specified pathname was not a directory when a directory |
---|
| 1323 | was expected. |
---|
| 1324 | @item EPERM |
---|
| 1325 | Operation is not permitted. Process does not have the appropriate priviledges |
---|
| 1326 | or permissions to perform the requested operations. |
---|
| 1327 | @item EROFS |
---|
| 1328 | Read-only file system. |
---|
| 1329 | |
---|
| 1330 | @end table |
---|
| 1331 | |
---|
| 1332 | @subheading DESCRIPTION: |
---|
| 1333 | |
---|
| 1334 | The user ID and group ID of the file named by @code{path} are set to |
---|
[6385cbd] | 1335 | @code{owner} and @code{path}, respectively. |
---|
[08142b48] | 1336 | |
---|
| 1337 | For regular files, the set group ID (S_ISGID) and set user ID (S_ISUID) |
---|
| 1338 | bits are cleared. |
---|
| 1339 | |
---|
| 1340 | Some systems consider it a security violation to allow the owner of a file to |
---|
| 1341 | be changed, If users are billed for disk space usage, loaning a file to |
---|
[8dd54b6] | 1342 | another user could result in incorrect billing. The @code{cfg_chown()} function |
---|
[08142b48] | 1343 | may be restricted to privileged users for some or all files. The group ID can |
---|
| 1344 | still be changed to one of the supplementary group IDs. |
---|
| 1345 | |
---|
| 1346 | @subheading NOTES: |
---|
| 1347 | |
---|
| 1348 | This function may be restricted for some file. The @code{pathconf} function |
---|
| 1349 | can be used to test the _PC_CHOWN_RESTRICTED flag. |
---|
| 1350 | |
---|
| 1351 | |
---|