The kernel docs and man pages this subsystem encodes. Cite specific sections in the source when interpretation is non-obvious.
Man pages
sysctl(8)— the userspace tool whose surface this subsystem mirrors. The-a/-w/-psemantics, dot-form key naming, and the--systemworkflow that walks/etc/sysctl.d/*.confare all here. Linx exposes the-r/-wequivalents (read/write); the--systemconf-file applier is deferred to a consumer.proc(5)— the canonical reference for/proc/sys/, the layout of subtrees (net/,kernel/,vm/,fs/, …), and the per-namespace routing rules. The "Files and directories" section under/proc/sys/is the source of truth.namespaces(7)— overview of which namespaces own which parts of the sysctl tree (network fornet.*, UTS forkernel.hostname, IPC forkernel.shm*/kernel.msg*/kernel.sem/fs.mqueue.*).network_namespaces(7)— specifically the per-netns/proc/sys/net/semantics that makenet.ipv4.ip_forwardmeaningful inside a container.uts_namespaces(7),ipc_namespaces(7)— analogous references for the UTS / IPC subtrees.setns(2)— the syscall the cross-namespace NIF wraps for reads and writes. Particularly the "Description" of valid namespace types and the "Notes" on what passing0for the second argument means (autodetect from the file's type).
Kernel documentation
Documentation/admin-guide/sysctl/— the kernel's own per- subtree docs:kernel.rst—kernel.*knobs (hostname, printk, panic, randomize_va_space, …)net.rst— top-levelnet.*knobs; per-protocol specifics live alongside the protocol's docsvm.rst—vm.*knobs (swappiness, overcommit, dirty_ratio, …)fs.rst—fs.*knobs (file-max, inotify limits, mqueue, …)user.rst— per-usernsuser.max_*_namespacesnesting limitsabi.rst—abi.*
Documentation/networking/ip-sysctl.rst— the exhaustive reference for everynet.ipv4.*andnet.ipv6.*knob.Documentation/networking/...sysctl.rst— analogous per- subsystem files (tcp.rst,nf_conntrack-sysctl.rst, …).
Adjacent userspace tooling (for context, not implementation)
procps-ng(sysctl(8)) — the canonical userspace tool. Worth skimming the source for edge cases in key normalization (the/vs.separator interchangeability, quoting of values containing whitespace).systemd-sysctl(8)— systemd's variant of the conf-file applier; samesysctl.dsemantics with some extensions. Relevant as a reference design for an eventual consumer-side conf-file layer (not in Linx).nerves_system_*defconfigs — for the Nerves use case, the set ofCONFIG_*kernel options that determines which sysctls exist on a given device.Linx.Sysctl.list/0is the way to discover what's actually present at runtime.
In-repo cross-references
Linx.Mount— the:in :: :self | {:pid, n} | {:path, p}option shape and the setns-on-a-throwaway-pthread pattern.Linx.Sysctl's cross-namespace NIF is structurally identical.lib/linx/mount.exandc_src/linx_mount.c— the precedent the cross-namespace implementation mirrors end-to-end.Linx.User— the pure-Elixir-procfs precedent (no NIF, no Port).lib/linx/cgroup.ex— another pure-procfs subsystem, useful as a reference for%Linx.Cgroup.Error{}-style structured errors thatLinx.Sysctl.Errormirrors.