new stuff
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Fri, 16 May 1986 04:41:03 +0000 (20:41 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Fri, 16 May 1986 04:41:03 +0000 (20:41 -0800)
SCCS-vsn: lib/libc/gen/syslog.3 6.6

usr/src/lib/libc/gen/syslog.3

index 080f28f..01c7d3c 100644 (file)
@@ -2,7 +2,7 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
-.\"    @(#)syslog.3    6.5 (Berkeley) %G%
+.\"    @(#)syslog.3    6.6 (Berkeley) %G%
 .\"
 .TH SYSLOG 3 ""
 .UC 5
 .\"
 .TH SYSLOG 3 ""
 .UC 5
@@ -75,10 +75,10 @@ normally of use only when debugging a program.
 If
 .I syslog
 cannot pass the message to
 If
 .I syslog
 cannot pass the message to
-.I syslogd
-and the message is priority LOG_ERR or higher,
-it attempts to write the message on
-.IR /dev/console.
+.IR syslogd ,
+it will attempt to write the message on
+.I /dev/console
+if the LOG_CONS option is set (see below).
 .PP
 If special processing is needed,
 .I openlog
 .PP
 If special processing is needed,
 .I openlog
@@ -102,24 +102,31 @@ terminal since
 .I syslog
 will fork before opening the console.
 .IP LOG_NDELAY \w'LOG_WARNING'u+3
 .I syslog
 will fork before opening the console.
 .IP LOG_NDELAY \w'LOG_WARNING'u+3
-Opening the connection to
+Open the connection to
 .I syslogd
 immediately.
 Normally the open is delayed
 until the first message is logged.
 Useful for programs that need to manage the
 order in which file descriptors are allocated.
 .I syslogd
 immediately.
 Normally the open is delayed
 until the first message is logged.
 Useful for programs that need to manage the
 order in which file descriptors are allocated.
+.IP LOG_NOWAIT \w'LOG_WARNING'u+3
+Don't wait for children forked to log messages on the console.
+This option should be used by processes that enable notification
+of child termination via SIGCHLD, as
+.I syslog
+may otherwise block waiting for a child whose exit status has already
+been collected.
 .PP
 The
 .I facility
 .PP
 The
 .I facility
-parameter is encodes a default facility to be assigned to all messages
+parameter encodes a default facility to be assigned to all messages
 that do not have an explicit facility encoded:
 .IP LOG_KERN \w'LOG_WARNING'u+3
 Messages generated by the kernel.
 These cannot be generated by any user processes.
 .IP LOG_USER \w'LOG_WARNING'u+3
 Messages generated by random user processes.
 that do not have an explicit facility encoded:
 .IP LOG_KERN \w'LOG_WARNING'u+3
 Messages generated by the kernel.
 These cannot be generated by any user processes.
 .IP LOG_USER \w'LOG_WARNING'u+3
 Messages generated by random user processes.
-This is the default if none is specified.
+This is the default facility identifier if none is specified.
 .IP LOG_MAIL \w'LOG_WARNING'u+3
 The mail system.
 .IP LOG_DAEMON \w'LOG_WARNING'u+3
 .IP LOG_MAIL \w'LOG_WARNING'u+3
 The mail system.
 .IP LOG_DAEMON \w'LOG_WARNING'u+3
@@ -152,15 +159,22 @@ sets the log priority mask to
 and returns the previous mask.
 Calls to
 .I syslog
 and returns the previous mask.
 Calls to
 .I syslog
-with a priority lower than
+with a priority not set in
 .I maskpri
 are rejected.
 .I maskpri
 are rejected.
+The mask for an individual priority
+.I pri
+is calculated by the macro LOG_MASK(\fIpri\fP);
+the mask for all priorities up to and including
+.I toppri
+is given by the macro LOG_UPTO(\fItoppri\fP).
 The default allows all priorities to be logged.
 .SH EXAMPLES
 .nf
 syslog(LOG_ALERT, "who: internal error 23");
 
 openlog("ftpd", LOG_PID, LOG_DAEMON);
 The default allows all priorities to be logged.
 .SH EXAMPLES
 .nf
 syslog(LOG_ALERT, "who: internal error 23");
 
 openlog("ftpd", LOG_PID, LOG_DAEMON);
+setlogmask(LOG_UPTO(LOG_ERR));
 syslog(LOG_INFO, "Connection from host %d", CallingHost);
 
 syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");
 syslog(LOG_INFO, "Connection from host %d", CallingHost);
 
 syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");