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:
Sebastian Huber 2014-01-20 12:50:23 +01:00
parent 164c5f5320
commit 08c8588440
2 changed files with 6 additions and 10 deletions

View File

@ -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? */

View File

@ -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);
}