Lines 48-56
Link Here
|
48 |
.Fd #include <syslog.h> |
48 |
.Fd #include <syslog.h> |
49 |
.Fd #include <varargs.h> |
49 |
.Fd #include <varargs.h> |
50 |
.Ft void |
50 |
.Ft void |
51 |
.Fn syslog "int priority" "const char *message" "..." |
51 |
.Fn syslog "int priority" "const char *fmt" "..." |
52 |
.Ft void |
52 |
.Ft void |
53 |
.Fn vsyslog "int priority" "const char *message" "va_list args" |
53 |
.Fn vsyslog "int priority" "const char *fmt" "va_list args" |
54 |
.Ft void |
54 |
.Ft void |
55 |
.Fn openlog "const char *ident" "int logopt" "int facility" |
55 |
.Fn openlog "const char *ident" "int logopt" "int facility" |
56 |
.Ft void |
56 |
.Ft void |
Lines 60-92
Link Here
|
60 |
.Sh DESCRIPTION |
60 |
.Sh DESCRIPTION |
61 |
The |
61 |
The |
62 |
.Fn syslog |
62 |
.Fn syslog |
63 |
function |
63 |
function writes a message to the system message logger. |
64 |
writes |
|
|
65 |
.Fa message |
66 |
to the system message logger. |
67 |
The message is then written to the system console, log files, |
64 |
The message is then written to the system console, log files, |
68 |
logged-in users, or forwarded to other machines as appropriate. |
65 |
logged-in users, or forwarded to other machines as appropriate. |
69 |
(See |
66 |
(See |
70 |
.Xr syslogd 8 . ) |
67 |
.Xr syslogd 8 . ) |
71 |
.Pp |
68 |
.Pp |
72 |
The message is identical to a |
69 |
The message is created by treating |
73 |
.Xr printf 3 |
70 |
.Va fmt |
74 |
format string, except that |
71 |
as a format string that specifies how subsequent arguments are |
|
|
72 |
converted, in the same was as |
73 |
.Xr printf 3 , |
74 |
with an additional convertion specifier of |
75 |
.Ql %m |
75 |
.Ql %m |
76 |
is replaced by the current error |
76 |
which is replaced by the current error message. (As denoted by |
77 |
message. |
77 |
the global variable |
78 |
(As denoted by the global variable |
|
|
79 |
.Va errno ; |
78 |
.Va errno ; |
80 |
see |
79 |
see |
81 |
.Xr strerror 3 . ) |
80 |
.Xr strerror 3 . ) |
82 |
A trailing newline is added if none is present. |
81 |
If the format string specifies arguments that do not exist, or it |
|
|
82 |
specifies a type different from that actually given, random errors, |
83 |
that could cause a security risk, may occur. A trailing newline |
84 |
is added if none is present. |
83 |
.Pp |
85 |
.Pp |
84 |
The |
86 |
The |
85 |
.Fn vsyslog |
87 |
.Fn vsyslog |
86 |
function |
88 |
function is an alternate form in which the arguments have already |
87 |
is an alternate form in which the arguments have already been captured |
89 |
been captured using the variable-length argument facilities of |
88 |
using the variable-length argument facilities of |
90 |
.Xr stdarg 3 . |
89 |
.Xr varargs 3 . |
|
|
90 |
.Pp |
91 |
.Pp |
91 |
The message is tagged with |
92 |
The message is tagged with |
92 |
.Fa priority . |
93 |
.Fa priority . |