Hi,

The the inlined patch aims to document the new sendsyslog2 system call,
and add the corresponding MLINKS entry. Note that I do not put
"syslog(3) logopt LOG_CONS" or "syslog(3) LOG_CONS flag" because
actually in syslog(3) it says that it redirects to "/dev/console", so I
thought that could be misleading as sendsyslog2(2) does not open the
device, it is a direct channel.

Comments?


Regards,
Rafael Neves


Patch:

Index: lib/libc/sys/Makefile.inc
===================================================================
RCS file: /cvs/src/lib/libc/sys/Makefile.inc,v
retrieving revision 1.137
diff -u -p -r1.137 Makefile.inc
--- lib/libc/sys/Makefile.inc   25 Nov 2015 00:01:21 -0000      1.137
+++ lib/libc/sys/Makefile.inc   18 Feb 2016 21:31:31 -0000
@@ -224,6 +224,7 @@ MLINKS+=select.2 pselect.2
 MLINKS+=select.2 FD_ISSET.3 select.2 FD_ZERO.3
 MLINKS+=select.2 FD_SET.3 select.2 FD_CLR.3
 MLINKS+=send.2 sendmsg.2 send.2 sendto.2
+MLINKS+=sendsyslog.2 sendsyslog2.2
 MLINKS+=setpgid.2 setpgrp.2
 MLINKS+=setresuid.2 getresgid.2 setresuid.2 getresuid.2
 MLINKS+=setresuid.2 setresgid.2
Index: lib/libc/sys/sendsyslog.2
===================================================================
RCS file: /cvs/src/lib/libc/sys/sendsyslog.2,v
retrieving revision 1.4
diff -u -p -r1.4 sendsyslog.2
--- lib/libc/sys/sendsyslog.2   10 Sep 2015 17:55:21 -0000      1.4
+++ lib/libc/sys/sendsyslog.2   18 Feb 2016 21:31:31 -0000
@@ -18,19 +18,40 @@
 .Dt SENDSYSLOG 2
 .Os
 .Sh NAME
-.Nm sendsyslog
+.Nm sendsyslog ,
+.Nm sendsyslog2
 .Nd send a message to syslogd
 .Sh SYNOPSIS
+.In sys/syslog.h
 .In sys/types.h
 .Ft int
 .Fn sendsyslog "const void *msg" "size_t len"
+.Ft int
+.Fn sendsyslog2 "const void *msg" "size_t len" "int flags"
 .Sh DESCRIPTION
+.Pp
+The
 .Fn sendsyslog
-is used to transmit a
+and
+.Fn sendsyslog2
+functions are used to transmit a
 .Xr syslog 3
 formatted message direct to
 .Xr syslogd 8
 without requiring the allocation of a socket.
+.Pp
+The
+.Fa flags
+argument of
+.Fn sendsyslog2
+accepts the
+.Dv LOG_CONS
+flag. If 
+.Dv LOG_CONS
+is specified, and
+.Xr syslogd 8
+is not accepting messages, the message will be sent directly to the
+console.
 This is used internally by
 .Xr syslog_r 3 ,
 so that messages can be sent during difficult situations.
@@ -41,7 +62,9 @@ so that messages can be sent during diff
 can fail if:
 .Bl -tag -width Er
 .It Bq Er ENOTCONN
-The message cannot be sent, likely because
+The message cannot be sent to 
+.Xr syslogd(8) ,
+likely because
 .Xr syslogd 8
 is not running.
 .El
@@ -53,3 +76,7 @@ The
 .Fn sendsyslog
 function call appeared in
 .Ox 5.6 .
+The
+.Fn sendsyslog2
+function call appeared in
+.Ox 5.9 .

Reply via email to