mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 01:29:19 +08:00
PRINTF(9): Do not use printk() for log()
The BSD library functions must use printk(). The %D format specifier is not supported, thus we cannot use the printf() family for output.
This commit is contained in:
parent
164c5f5320
commit
08c8588440
@ -115,6 +115,9 @@ the current Git submodule commit is this
|
|||||||
destruction. Add support for file descriptor transmission via control
|
destruction. Add support for file descriptor transmission via control
|
||||||
messages.
|
messages.
|
||||||
|
|
||||||
|
* PRINTF(9): Add support for log(), the %D format specifier is missing in the
|
||||||
|
normal printf() family.
|
||||||
|
|
||||||
[listing]
|
[listing]
|
||||||
----
|
----
|
||||||
/* sysinit section? */
|
/* sysinit section? */
|
||||||
|
@ -37,17 +37,10 @@
|
|||||||
#include <rtems/bsd/sys/types.h>
|
#include <rtems/bsd/sys/types.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
|
||||||
/*
|
#include <stdio.h>
|
||||||
* Log writes to the log buffer, and guarantees not to sleep (so can be
|
|
||||||
* called by interrupt routines). If there is no process reading the
|
|
||||||
* log yet, it writes to the console also.
|
|
||||||
*/
|
|
||||||
void
|
void
|
||||||
log(int level, const char *fmt, ...)
|
log(int level, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
puts(fmt);
|
||||||
|
|
||||||
va_start(ap, fmt);
|
|
||||||
vprintk(fmt, ap);
|
|
||||||
va_end(ap);
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user