SYSFATAL(3)
π SYSFATAL(3) β Library Functions Manual, bestie π
Okay so this page is all about syslog and sysfatal, the system-error-message duo. No cap, every detail is here. β¨
πΈ NAME πΈ
syslog,sysfatalβ system error messages, aka the little error-message besties you need to know about.
β¨ SYNOPSIS β¨
#include <u.h>
#include <libc.h>
void syslog(int cons, char *logname, char *fmt, ...)
void sysfatal(char *fmt, ...)
π¦ DESCRIPTION π¦
π
sysfatal β the dramatic exit
sysfatal prints to standard error, in order: the name of the running program, a colon and a space, the message described by the print(3) format string fmt plus any following arguments, and a newline. Then it calls exits(3) with the formatted message as the argument. Iconic behavior, honestly. π
The program's name is the value of argv0, and that gets set if the program uses the arg(3) interface to process its arguments. If argv0 is null, it is ignored and the following colon and space are suppressed. So no name, no colon-space situation β periodt.
πͺ΅ syslog β the lowkey logger
syslog logs messages in the file named by logname in the directory /log. The file must already exist and is opened append-only. logname must contain no slashes. This is not a suggestion, bestie β no slashes, fr fr. π«
Each message is a line with several fields:
- the name of the machine writing the message
- the date and time
- the message specified by the
print(3)formatfmtand any following arguments - a final newline
If cons is set or the log file cannot be opened, the message is also printed on the system console. And good news: syslog can be used safely in multi-threaded programs. Slay for thread safety. π§β¨
π₯ SOURCE π₯
/src/lib9/sysfatal.c/src/lib9/syslog.c
π SEE ALSO π
Cute sign-off: footer says SYSFATAL(3) β that's the source/version/date line we got, and we're out. ππ
β¨
π¦ where this page comes from
- alpine 3.24: plan9port-doc 0_git20260208-r0 Β· LPL-1.02
- arch rolling: plan9port 20261021-2 Β· custom
- nixos 26.05: plan9port 0-unstable-2025-11-10
- nixos 26.05: plan9port-wayland 0-unstable-2025-11-26
- nixpkgs unstable: plan9port 0-unstable-2025-11-10
- nixpkgs unstable: plan9port-wayland 0-unstable-2025-11-26
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms