pub fn default_runtime_dir() -> Option<PathBuf>Expand description
Per-user runtime directory for short-lived sockets and pid files.
Resolution order:
- Linux:
$XDG_RUNTIME_DIR/cfgdif set, else$HOME/.cache/cfgd. The base$XDG_RUNTIME_DIRis owner-private by spec; the cache fallback is under the user’s home where Linux-default permissions already protect it. - macOS:
$HOME/Library/Application Support/cfgd. There is no per-usertmpfson macOS, and$TMPDIRis per-user but still world-traversable when the umask leaks; Application Support is the conventional per-user location for app state. - Windows:
%LOCALAPPDATA%\cfgdviadirectories::BaseDirs. (Daemons on Windows use named pipes, which are kernel objects — this path is provided for parity and is unused by the daemon socket flow.)
Honors the TestHomeGuard thread-local override on every platform so
tests can redirect the runtime dir without mutating process-global env
state. Returns None only when no home directory can be resolved at all.