12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

KPRINTF (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> KPRINTF (9)voidaprint_verbose_dev(device_t , const char ∗format , ...);voidaprint_debug_dev(device_t , const char ∗format , ...);voidaprint_error_dev(device_t , const char ∗format , ...);voidaprint_normal_ifnet(struct ifnet ∗ , const char ∗format , ...);voidaprint_naive_ifnet(struct ifnet ∗ , const char ∗format , ...);voidaprint_verbose_ifnet(struct ifnet ∗ , const char ∗format , ...);voidaprint_debug_ifnet(struct ifnet ∗ , const char ∗format , ...);voidaprint_error_ifnet(struct ifnet ∗ , const char ∗format , ...);intaprint_get_error_count(void);DESCRIPTIONThe printf() family of functions allows the kernel to send formatted messages to various output devices.The functions printf() and vprintf() send formatted strings to the system console. Theprintf_nolog() function is identical to printf(), except it does not send the data to the system log.The functions snprintf() and vsnprintf() write output to a string buffer. These four functions worksimilarly to their user space counterparts, and are not described in detail here.The functions uprintf() and ttyprintf() send formatted strings to the current process’s controlling ttyand 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. Ahandleis acquired by calling tprintf_open() with the target process as an argument. This handle must beclosed with a matching call to tprintf_close().The functions aprint_normal(), aprint_naive(), aprint_verbose(), aprint_debug(), andaprint_error() are intended to be used to print autoconfiguration messages, and change their behaviorbased on flags in the “boothowto” variable:aprint_normal()aprint_naive()aprint_verbose()aprint_debug()aprint_error()Sends to the console unless AB_QUIET is set. Always sends to the log.Sends to the console only if AB_QUIET is set. Never sends to the log.Sends to the console only if AB_VERBOSE is set. Always sends to the log.Sends to the console and the log only if AB_DEBUG is set.Like aprint_normal(), but also keeps track of the number of times called. Thisallows a subsystem to report the number of errors that occurred during a quiet orsilent initialization phase.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 adevice_t or<strong>NetBSD</strong> 3.0 September 24, 2007 2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!