PERROR(2) PERROR(2)
NAME
perror, syslog - system error messages
SYNOPSIS
void perror(char *s)
void syslog(int cons, char *logname, char *fmt, ...)
DESCRIPTION
Perror produces a short error message on the standard error
file describing the last error encountered during a call to
the system. First the argument string s is printed, then a
colon, then the message and a new-line. If s is 0, only the
error message and new-line are printed.
Syslog logs messages in the file named by logname in the
directory /sys/log; the file must already exist and should
be append-only. Logname must contain no slashes. The mes-
sage is a line with up to five fields: the current time; the
program name (if argv0 is set; see ARG(2)); the user name;
the message specified by the print(2) format fmt and any
following arguments; and a final newline. If cons is set or
the log file cannot be opened, the message is also printed
on the system console. Syslog can be used safely in multi-
threaded programs.
SEE ALSO
intro(2), errstr(2)
Page 1 Plan 9 (printed 11/20/25)