KPRINTF(9) | Kernel Developer's Manual | KPRINTF(9) |
void
device_printf(device_t, const char *format, ...);
void
printf(const char *format, ...);
void
printf_nolog(const char *format, ...);
int
snprintf(char *buf, size_t size, const char *format, ...);
void
vprintf(const char *format, va_list ap);
int
vsnprintf(char *buf, size_t size, const char *format, va_list ap);
void
uprintf(const char *format, ...);
void
ttyprintf(struct tty *tty, const char *format, ...);
#include <sys/tprintf.h>
tpr_t
tprintf_open(struct proc *p);
void
tprintf(tpr_t tpr, const char *format, ...);
void
tprintf_close(tpr_t tpr);
void
aprint_normal(const char *format, ...);
void
aprint_naive(const char *format, ...);
void
aprint_verbose(const char *format, ...);
void
aprint_debug(const char *format, ...);
void
aprint_error(const char *format, ...);
void
aprint_normal_dev(device_t, const char *format, ...);
void
aprint_naive_dev(device_t, const char *format, ...);
void
aprint_verbose_dev(device_t, const char *format, ...);
void
aprint_debug_dev(device_t, const char *format, ...);
void
aprint_error_dev(device_t, const char *format, ...);
void
aprint_normal_ifnet(struct ifnet *, const char *format, ...);
void
aprint_naive_ifnet(struct ifnet *, const char *format, ...);
void
aprint_verbose_ifnet(struct ifnet *, const char *format, ...);
void
aprint_debug_ifnet(struct ifnet *, const char *format, ...);
void
aprint_error_ifnet(struct ifnet *, const char *format, ...);
int
aprint_get_error_count(void);
The functions uprintf() and ttyprintf() send formatted strings to the current process's controlling tty and a specific tty, respectively.
The tprintf() function sends formatted strings to a process's controlling tty, via a handle of type tpr_t. This allows multiple write operations to the tty with a guarantee that the tty will be valid across calls. A handle is acquired by calling tprintf_open() with the target process as an argument. This handle must be closed with a matching call to tprintf_close().
The functions aprint_normal(), aprint_naive(), aprint_verbose(), aprint_debug(), and aprint_error() are intended to be used to print autoconf(9) messages. Their verbosity depends on flags set in the boothowto variable, through options passed during bootstrap; see boothowto(9) and Interactive mode in boot(8):
The aprint_*() functions have the following behaviour, based on the above mentioned flags:
For the aprint_*() functions there are two additional families of functions with the suffixes _dev and _ifnet which work like their counterparts without the suffixes, except that they take a device_t and struct ifnet *, respectively, as first argument, and prefix the log message with the corresponding device or interface name.
The aprint_get_error_count() function reports the number of errors and resets the counter to 0.
If AB_SILENT is set, none of the autoconfiguration message printing routines send output to the console. The AB_VERBOSE and AB_DEBUG flags override AB_SILENT.
The tprintf_open() function returns NULL if no terminal handle could be acquired.
In NetBSD 1.5 and earlier, printf() supported more format strings than the user space printf(). These nonstandard format strings are no longer supported. For the functionality provided by the former %b
format string, see snprintb(3).
The aprint_normal(), aprint_naive(), aprint_verbose(), and aprint_debug() functions first appeared in BSD/OS.
January 21, 2011 | NetBSD 6.1 |