Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (n - r) printf(3)
to the specified width.
For TNS/E systems only, the behavior of ls is the same as the behavior of
S.
p Accepts a pointer to void. The value of the pointer is converted to a
sequence of printable characters, the same as unsigned hexadecimal
integer (x).
n Accepts a pointer to an integer into which is written the number of char-
acters written to the output stream so far by this call. No argument is
converted.
If the result of a conversion is wider than the field width, the field is expanded to contain the con-
verted result. No truncation occurs. However, a small precision can cause truncation on the
right.
The e, E, f, and g formats represent the special floating-point values as follows:
Quiet NaN NaN
Signaling NaN NaN
+/-INF +Inf or -Inf
+/-0 +0.0 or -0.0 (zero)
The representation of the + (plus sign) depends on whether the + or (space) formatting flag is
specified.
The printf() function allows for the insertion of a language-dependent radix character in the out-
put string. The radix character is defined by langinfo data in the program’s locale (category
LC_NUMERIC). In the C locale, or in a locale where the radix character is not defined, the
radix character defaults to . (period).
The st_ctime and st_mtime fields of the file are marked for update between the successful exe-
cution of the printf( ) function and the next successful completion of a call to the fflush() or
fclose() functions on the same stream, or a call to the exit() or abort() functions.
NOTES
This function supports both IEEE Std 754-1985 floating-point and Tandem floating-point values
in the native environment. IEEE values can include NaN and infinity, and the sign of 0.0 (zero)
can be either positive or negative. Refer to the fp_class(3) reference page for a description of
IEEE value classes.
Guardian functions are available to convert between floating-point formats. Refer to the Guar-
dian Programmer’s Guide for a discussion of floating-point conversions.
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 printf() function fails if the standard output stream is unbuffered, or if the buffer needed to
be flushed and the function call caused an underlying write( ) or lseek() function to be invoked.
In addition, if the printf() function fails, errno is set to one of the following values:
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor underlying the output
stream and the process would be delayed in the write operation.
527192-018 Hewlett-Packard Company 5−57