mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 01:39:57 +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
|
||||
messages.
|
||||
|
||||
* PRINTF(9): Add support for log(), the %D format specifier is missing in the
|
||||
normal printf() family.
|
||||
|
||||
[listing]
|
||||
----
|
||||
/* sysinit section? */
|
||||
|
@ -37,17 +37,10 @@
|
||||
#include <rtems/bsd/sys/types.h>
|
||||
#include <sys/systm.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.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
log(int level, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vprintk(fmt, ap);
|
||||
va_end(ap);
|
||||
puts(fmt);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user