Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Implement vlog() (varargs version of log()).
details: https://anonhg.NetBSD.org/src/rev/d6e4d08f5d22
branches: trunk
changeset: 475829:d6e4d08f5d22
user: thorpej <thorpej%NetBSD.org@localhost>
date: Fri Aug 27 01:14:15 1999 +0000
description:
Implement vlog() (varargs version of log()).
diffstat:
sys/kern/subr_prf.c | 26 +++++++++++++++++++++++++-
sys/sys/syslog.h | 3 ++-
2 files changed, 27 insertions(+), 2 deletions(-)
diffs (57 lines):
diff -r f4e0e1de7e77 -r d6e4d08f5d22 sys/kern/subr_prf.c
--- a/sys/kern/subr_prf.c Fri Aug 27 00:47:25 1999 +0000
+++ b/sys/kern/subr_prf.c Fri Aug 27 01:14:15 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_prf.c,v 1.63 1999/07/27 21:50:37 thorpej Exp $ */
+/* $NetBSD: subr_prf.c,v 1.64 1999/08/27 01:14:15 thorpej Exp $ */
/*-
* Copyright (c) 1986, 1988, 1991, 1993
@@ -259,6 +259,30 @@
}
/*
+ * vlog: write to the log buffer [already have va_alist]
+ */
+
+void
+vlog(level, fmt, ap)
+ int level;
+ const char *fmt;
+ va_list ap;
+{
+ int s;
+
+ KPRINTF_MUTEX_ENTER(s);
+
+ klogpri(level); /* log the level first */
+ kprintf(fmt, TOLOG, NULL, NULL, ap);
+ if (!log_open)
+ kprintf(fmt, TOCONS, NULL, NULL, ap);
+
+ KPRINTF_MUTEX_EXIT(s);
+
+ logwakeup(); /* wake up anyone waiting for log msgs */
+}
+
+/*
* logpri: log the priority level to the klog
*/
diff -r f4e0e1de7e77 -r d6e4d08f5d22 sys/sys/syslog.h
--- a/sys/sys/syslog.h Fri Aug 27 00:47:25 1999 +0000
+++ b/sys/sys/syslog.h Fri Aug 27 01:14:15 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syslog.h,v 1.20 1999/03/19 00:15:45 perry Exp $ */
+/* $NetBSD: syslog.h,v 1.21 1999/08/27 01:14:16 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1993
@@ -198,6 +198,7 @@
void logpri __P((int));
void log __P((int, const char *, ...))
__kprintf_attribute__((__format__(__kprintf__,2,3)));
+void vlog __P((int, const char *, _BSD_VA_LIST_));
void addlog __P((const char *, ...))
__kprintf_attribute__((__format__(__kprintf__,1,2)));
void logwakeup __P((void));
Home |
Main Index |
Thread Index |
Old Index