https://github.com/shamazmazum/freebsd-sysctl
FreeBSD's sysctl interface to common lisp
https://github.com/shamazmazum/freebsd-sysctl
freebsd sysctl
Last synced: 4 months ago
JSON representation
FreeBSD's sysctl interface to common lisp
- Host: GitHub
- URL: https://github.com/shamazmazum/freebsd-sysctl
- Owner: shamazmazum
- License: bsd-2-clause
- Created: 2017-02-24T15:19:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-02-21T07:49:41.000Z (almost 5 years ago)
- Last Synced: 2025-06-10T01:31:21.342Z (8 months ago)
- Topics: freebsd, sysctl
- Language: Common Lisp
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
freebsd-sysctl
=============
[](https://cirrus-ci.com/github/shamazmazum/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.
~~~~~~~~~~~~~~~~{.lisp}
;; Read a sysctl value
(freebsd-sysctl:sysctl-by-name "kern.hz")
;; >> 1000
;; >> NIL
;; You can also access values via MIBs (Management Information Base)
(freebsd-sysctl:sysctl (freebsd-sysctl:sysctl-name=>mib "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`.