vdprintf()

Updated: April 19, 2023

Write output to a file associated with a file descriptor (varargs)

Synopsis:

#include <stdio.h>
#include <stdarg.h>

int vdprintf( int filedes,
              const char* format,
              va_list arg );

Arguments:

filedes
A file descriptor that's associated with the file where you want to send the output.
format
A string that specifies the format of the output. The formatting string determines what additional arguments you need to provide. For more information, see printf().
arg
A variable-argument list of the additional arguments, which you must have initialized with the va_start() macro.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The vdprintf() function writes output to the file associated with the file descriptor filedes, under control of the format specifier.

The vdprintf() function is a “varargs” version of dprintf().

Returns:

The number of characters written, or a negative value if an output error occurred (errno is set).

Classification:

POSIX 2008

Safety:  
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes