*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> tprintf_open (9)              



NAME    [Toc]    [Back]

     printf, snprintf, vprintf, vsnprintf, uprintf, ttyprintf, tprintf - kernel
 formatted output conversion

SYNOPSIS    [Toc]    [Back]

     #include <sys/systm.h>

     printf(const char *format, ...);

     snprintf(char *buf, size_t size, const char *format, ...);

     vprintf(const char *format, va_list ap);

     vsnprintf(char *buf, size_t size, const char *format, va_list ap);

     uprintf(const char *format, ...);

     ttyprintf(struct tty *tty, const char *format, ...);

     #include <sys/tprintf.h>

     tprintf_open(struct proc *p);

     tprintf(tpr_t tpr, const char *format, ...);

     tprintf_close(tpr_t tpr);

DESCRIPTION    [Toc]    [Back]

     The 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.  The functions snprintf()
     and vsnprintf() write output to a string buffer.  These four functions
     work similarly 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 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

RETURN VALUES    [Toc]    [Back]

     The snprintf() and vsnprintf() functions return the number of characters
     placed in the buffer buf.

SEE ALSO    [Toc]    [Back]

     printf(1), printf(3), bitmask_snprintf(9)

CODE REFERENCES    [Toc]    [Back]


HISTORY    [Toc]    [Back]

     The sprintf() and vsprintf() unsized string formatting functions are supported
 for compatibility only, and are not documented here.  New code
     should use the size-limited snprintf() and vsnprintf() functions instead.

     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 bitmask_snprintf(9).

BUGS    [Toc]    [Back]

     The uprintf() and ttyprintf() functions should be used sparingly, if at
     all.  Where multiple lines of output are required to reach a process's
     controlling terminal, tprintf() is preferred.

BSD                            September 1, 1998                           BSD
[ Back ]
 Similar pages
Name OS Title
vsnprintf NetBSD formatted output conversion
vprintf FreeBSD formatted output conversion
fprintf OpenBSD formatted output conversion
vfprintf FreeBSD formatted output conversion
asprintf FreeBSD formatted output conversion
vasprintf FreeBSD formatted output conversion
uprintf FreeBSD formatted output conversion
tprintf FreeBSD formatted output conversion
asprintf OpenBSD formatted output conversion
snprintf FreeBSD formatted output conversion
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service