xref: /openbsd-src/lib/libc/sys/sendsyslog.2 (revision 50b7afb2c2c0993b0894d4e34bf857cb13ed9c80)
1.\"	$OpenBSD: sendsyslog.2,v 1.2 2014/07/12 17:06:06 jmc Exp $
2.\"
3.\" Copyright (c) 2014 Theo de Raadt
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: July 12 2014 $
18.Dt SENDSYSLOG 2
19.Os
20.Sh NAME
21.Nm sendsyslog
22.Nd send a message to syslogd
23.Sh SYNOPSIS
24.Fd #include <sys/types.h>
25.Ft int
26.Fn sendsyslog "const void *msg" "size_t len"
27.Sh DESCRIPTION
28.Fn sendsyslog
29is used to transmit a
30.Xr syslog 3
31formatted message direct to
32.Xr syslogd 8
33without requiring the allocation of a socket.
34This is used internally by
35.Xr syslog_r 3 ,
36so that messages can be sent during difficult situations.
37.Sh RETURN VALUES
38The call returns 0 on success, or \-1
39if an error occurred.
40.Sh ERRORS
41.Fn sendsyslog
42can fail if:
43.Bl -tag -width Er
44.It Bq Er ENOTCONN
45The message cannot be sent, likely because
46.Xr syslogd 8
47is not running.
48.El
49.Sh SEE ALSO
50.Xr syslog_r 3 ,
51.Xr syslogd 8
52.Sh HISTORY
53The
54.Fn sendsyslog
55function call appeared in
56.Ox 5.6 .
57