Next: , Previous: , Up: posix   [Index]


4.20 System configuration

The following bindings are exported by the (vicare posix) library. If an error occurs: all the following functions raise an exception with condition components &errno, &error, &who, &message, &irritants.

Function: sysconf parameter

Interface to the C function sysconf(), (libc)sysconf. Query the system for a configuration value selected by the exact integer parameter among the _SC_ constants. If successful and a value is available: return a positive exact integer; if successful but no value is available return false; if parameter is invalid raise an exception.

NOTE This function assumes that all the validly returnable values are non–negative. If a value is negative, the behaviour is unspecified.

Function: pathconf pathname parameter

Interface to the C function pathconf(), (libc)pathconf. Query the system for a configuration value associated to the file pathname selected by the exact integer parameter among the _PC_ constants.

pathname must be a string or bytevector; if it is a string: it is converted to bytevector with the function referenced by string->filename-func.

If successful and a value is available: return a positive exact integer; if successful but no value is available return false; if parameter is invalid raise an exception.

NOTE This function assumes that all the validly returnable values are non–negative. If a value is negative, the behaviour is unspecified.

Function: fpathconf fd parameter

Interface to the C function fpathconf(), (libc)fpathconf. Query the system for a configuration value associated to the file descriptor fd selected by the exact integer parameter among the _PC_ constants.

If successful and a value is available: return a positive exact integer; if successful but no value is available return false; if parameter is invalid raise an exception.

NOTE This function assumes that all the validly returnable values are non–negative. If a value is negative, the behaviour is unspecified.

Function: confstr parameter
Function: confstr/string parameter

Interface to the C function confstr(), (libc)confstr. Query the system for a configuration value selected by the exact integer parameter among the _CS_ constants. If successful confstr returns a bytevector representing the value, confstr/string returns a string representing the value; else an exception is raised.

#!r6rs
(import (rnrs)
  (prefix (vicare posix) px.)
  (vicare platform constants))

(px.confstr/string _CS_PATH)
⇒ "/bin:/usr/bin"

Next: , Previous: , Up: posix   [Index]