Add vlog(9).

Reviewed by:	cem, jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D4183
This commit is contained in:
Mark Johnston 2015-11-19 05:50:22 +00:00
parent 4d7296f9aa
commit 07713dde22
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=291058
3 changed files with 13 additions and 2 deletions

View File

@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd September 8, 2006
.Dd November 18, 2015
.Dt PRINTF 9
.Os
.Sh NAME
@ -41,9 +41,13 @@
.Fn tprintf "struct proc *p" "int pri" "const char *fmt" ...
.Ft int
.Fn uprintf "const char *fmt" ...
.Ft int
.Fn vprintf "const char *fmt" "va_list ap"
.In sys/syslog.h
.Ft void
.Fn log "int pri" "const char *fmt" ...
.Ft void
.Fn vlog "int pri" "const char *fmt" "va_list ap"
.Sh DESCRIPTION
The
.Xr printf 9

View File

@ -302,9 +302,15 @@ log(int level, const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
(void)_vprintf(level, log_open ? TOLOG : TOCONS | TOLOG, fmt, ap);
vlog(level, fmt, ap);
va_end(ap);
}
void
vlog(int level, const char *fmt, va_list ap)
{
(void)_vprintf(level, log_open ? TOLOG : TOCONS | TOLOG, fmt, ap);
msgbuftrigger = 1;
}

View File

@ -207,6 +207,7 @@ int kvprintf(char const *, void (*)(int, void*), void *, int,
__va_list) __printflike(1, 0);
void log(int, const char *, ...) __printflike(2, 3);
void log_console(struct uio *);
void vlog(int, const char *, __va_list) __printflike(2, 0);
int asprintf(char **ret, struct malloc_type *mtp, const char *format,
...) __printflike(3, 4);
int printf(const char *, ...) __printflike(1, 2);