The kernel
printf( )
function prints error messages and
debugging information on the system console.
In addition, all messages are stored in
the /usr/adm/messages file
by a background program error handler.
printf(D3oddi)
is a simplified version of the standard C library
printf(S)
routine.
Arguments
The format parameter is a string to be displayed similar
to the format argument to
printf(S).
format also accepts specifications for displaying the
arg variables. The supported specifications are:
Type
Description
%b
two-digit hexadecimal byte
%c
character
%d
signed decimal
%o
unsigned octal
%s
string (character pointer)
%u
unsigned decimal
%x
hexadecimal (prints leading zeros)
Specification values can be indicated in either uppercase or
lowercase. Field length specifications cannot be used, but it is
possible to specify precision. For example, ``%9d'' would set
the minimum number of digits to be printed for a signed decimal to
nine. Escaped characters such as \n (new line), \t (tab), \r
(return), and so on are C language features supported by the C
compiler and thus are supported in this kernel routine.
Any optional arg parameters are displayed using the
format parameter.
Return values
None.
Usage
The printf routine is not interrupt-driven and therefore
suspends all other system activities while executing.
It is similar to the standard C library function
printf(S),
except that only the formats specified here are valid, and precision
is not supported.
It does not function properly on consoles running
layers(C).
As it is impossible for a driver to know if a console is running
layers, use of
printf(D3oddi)
for other than debug purposes is not recommended. Use
cmn_err(D3oddi)
instead.