The freebsd-sysctl Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The freebsd-sysctl Reference Manual

This is the freebsd-sysctl Reference Manual, version 1.0, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:54:50 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

freebsd-sysctl

freebsd-sysctl is a wrapper around sysctl system call for FreeBSD. It can be used, for example, in system monitors in StumpWM's mode line for tracking CPU temperature. Currently it can get/set sysctl variables, automatically detecting their formats, list sysctl nodes, etc.

Examples

Here is the documentation in a form of examples.

(freebsd-sysctl:sysctl-by-name "kern.hz")
;;  >> 1000
;;  >> NIL

;; It can detect temperature format
(freebsd-sysctl:sysctl-by-name "dev.cpu.0.temperature")
;;  >> 46.149994
;;  >> NIL

;; It also understands strings
(freebsd-sysctl:sysctl-by-name "dev.pcm.3.output")
;;  >> "Line-Out"
;;  >> NIL

;; You can set a new value to sysctl
(freebsd-sysctl:sysctl-by-name "dev.pcm.3.output" "Headphones")
;;  >> "Line-Out"
;;  >> "Headphones"

;; You can list a sysctl node
(freebsd-sysctl:list-sysctls "dev.pcm.3.play")
;;  >> ("dev.pcm.3.play.vchans" "dev.pcm.3.play.vchanmode" "dev.pcm.3.play.vchanrate"
;;      "dev.pcm.3.play.vchanformat")
~~~~~~~~~~~~~~~

TODO
----
Make it possible to get all sysctls as with `sysctl -a`.

Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 freebsd-sysctl

Maintainer

Vasily Postnicov <shamaz.mazum@gmail.com>

License

2-clause BSD

Description

Sysctl kernel control mechanism for common lisp

Version

1.0

Dependency

cffi

Source

freebsd-sysctl.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 freebsd-sysctl.asd

Location

freebsd-sysctl.asd

Systems

freebsd-sysctl (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 freebsd-sysctl/package.lisp

Parent

freebsd-sysctl (system)

Location

package.lisp

Packages

freebsd-sysctl


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 freebsd-sysctl/freebsd-sysctl.lisp

Dependency

package.lisp (file)

Parent

freebsd-sysctl (system)

Location

freebsd-sysctl.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 freebsd-sysctl

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: list-sysctls NAME

Returns a list of sysctls for the node with name NAME.

Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Function: sysctl MIB &optional NEW-VALUE

Perform sysctl call for a value specified by mib array. If new-value is specified, it will be set as a new value for that sysctl. Two values are returned: the old and the new value.

Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Function: sysctl-by-name NAME &optional NEW-VALUE

Same as SYSCTL, only it accepts string name for sysctl rather than mib array.

Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Function: sysctl-mib=>name MIB

Get sysctl name corresponding to mib array

Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Function: sysctl-name=>mib NAME

Get sysctl mib array corresponding to sysctl name.

Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Generic functions

Generic Function: sysctl-error-errno CONDITION
Package

freebsd-sysctl

Methods
Method: sysctl-error-errno (CONDITION sysctl-error)
Source

freebsd-sysctl.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Conditions

Condition: sysctl-error ()
Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Direct superclasses

error (condition)

Direct methods
Direct slots
Slot: errno
Initargs

:errno

Initform

(quote 0)

Readers

sysctl-error-errno (generic function)

Slot: message
Initargs

:message

Readers

sysctl-error-message (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Constants

Constant: +max-foreign-len+

Maximal foreign data chunk length

Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Constant: +max-mib-len+

Maximal number of elements in mib array

Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: get-errno ()
Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Function: interpret-result DATA LENGTH TYPE
Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Function: output-data FOREIGN-DATA TYPE DATA
Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Function: parse-temperature TEMP PRECISION
Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Function: strerror ERRNUM
Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Function: sysctl% NAME NAMELEN OLDP OLDLENP NEWP NEWLEN
Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Function: sysctl-name=>mib% NAME MIBP SIZEP
Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)

Function: sysctl-type MIB
Package

freebsd-sysctl

Source

freebsd-sysctl.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Generic functions

Generic Function: sysctl-error-message CONDITION
Package

freebsd-sysctl

Methods
Method: sysctl-error-message (CONDITION sysctl-error)
Source

freebsd-sysctl.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L  
Index Entry  Section

F
File, Lisp, freebsd-sysctl.asd: The freebsd-sysctl<dot>asd file
File, Lisp, freebsd-sysctl/freebsd-sysctl.lisp: The freebsd-sysctl/freebsd-sysctl<dot>lisp file
File, Lisp, freebsd-sysctl/package.lisp: The freebsd-sysctl/package<dot>lisp file
freebsd-sysctl.asd: The freebsd-sysctl<dot>asd file
freebsd-sysctl/freebsd-sysctl.lisp: The freebsd-sysctl/freebsd-sysctl<dot>lisp file
freebsd-sysctl/package.lisp: The freebsd-sysctl/package<dot>lisp file

L
Lisp File, freebsd-sysctl.asd: The freebsd-sysctl<dot>asd file
Lisp File, freebsd-sysctl/freebsd-sysctl.lisp: The freebsd-sysctl/freebsd-sysctl<dot>lisp file
Lisp File, freebsd-sysctl/package.lisp: The freebsd-sysctl/package<dot>lisp file

Jump to:   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   F   G   I   L   M   O   P   S  
Index Entry  Section

F
Function, get-errno: Internal functions
Function, interpret-result: Internal functions
Function, list-sysctls: Exported functions
Function, output-data: Internal functions
Function, parse-temperature: Internal functions
Function, strerror: Internal functions
Function, sysctl: Exported functions
Function, sysctl%: Internal functions
Function, sysctl-by-name: Exported functions
Function, sysctl-mib=>name: Exported functions
Function, sysctl-name=>mib: Exported functions
Function, sysctl-name=>mib%: Internal functions
Function, sysctl-type: Internal functions

G
Generic Function, sysctl-error-errno: Exported generic functions
Generic Function, sysctl-error-message: Internal generic functions
get-errno: Internal functions

I
interpret-result: Internal functions

L
list-sysctls: Exported functions

M
Method, sysctl-error-errno: Exported generic functions
Method, sysctl-error-message: Internal generic functions

O
output-data: Internal functions

P
parse-temperature: Internal functions

S
strerror: Internal functions
sysctl: Exported functions
sysctl%: Internal functions
sysctl-by-name: Exported functions
sysctl-error-errno: Exported generic functions
sysctl-error-errno: Exported generic functions
sysctl-error-message: Internal generic functions
sysctl-error-message: Internal generic functions
sysctl-mib=>name: Exported functions
sysctl-name=>mib: Exported functions
sysctl-name=>mib%: Internal functions
sysctl-type: Internal functions

Jump to:   F   G   I   L   M   O   P   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   +  
C   E   M   S  
Index Entry  Section

+
+max-foreign-len+: Internal constants
+max-mib-len+: Internal constants

C
Constant, +max-foreign-len+: Internal constants
Constant, +max-mib-len+: Internal constants

E
errno: Exported conditions

M
message: Exported conditions

S
Slot, errno: Exported conditions
Slot, message: Exported conditions

Jump to:   +  
C   E   M   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   F   P   S  
Index Entry  Section

C
Condition, sysctl-error: Exported conditions

F
freebsd-sysctl: The freebsd-sysctl system
freebsd-sysctl: The freebsd-sysctl package

P
Package, freebsd-sysctl: The freebsd-sysctl package

S
sysctl-error: Exported conditions
System, freebsd-sysctl: The freebsd-sysctl system

Jump to:   C   F   P   S