Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

vfprintf(3) Guardian Native C Library Calls Reference Manual
Guardian functions are available to convert between floating-point formats. Refer to the Guar-
dian Programmers Guide for a discussion of floating-point conversions.
EXAMPLES
The following example demonstrates how the vfprintf( ) function can be used to write an error
routine:
#include <stdarg.h>
#include <stdio.h>
void error(char *funct, char *fmt, ...)
{
va_list args;
/*
** Display the name of the function that called error
*/
fprintf(stderr, "ERROR in %s: ", funct);
/*
** Display the remainder of the message
*/
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
abort();
}
RETURN VALUES
Upon successful completion, this function returns the number of bytes in the output string. Oth-
erwise, a negative value is returned.
ERRORS
The vfprintf( ) function fails if stream is unbuffered, or if stream’s buffer needed to be flushed
and the function call caused an underlying write( ) or lseek() function to be invoked. In addi-
tion, if the vfprintf() function fails, errno is set to one of the following values:
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor underlying stream and the
process would be delayed in the write operation.
[EBADF] The file descriptor underlying stream is not a valid file descriptor open for writ-
ing.
[EFBIG] An attempt was made to write at or beyond the file offset maximum.
[EILSEQ] An invalid wide character was detected.
[EINTR] The operation was interrupted by a signal that was caught, and no data was
transferred.
[EINVAL] There are insufficient arguments.
[EIO] The implementation supports job control; the process is a member of a back-
ground process group attempting to write to its controlling terminal; TOSTOP is
set; the process is neither ignoring nor blocking SIGTTOU; and the process
group of the process is orphaned. This error might also be returned under
implementation-defined conditions.
766 Hewlett-Packard Company 527192-018