Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

spt_fputcx(2) OSS System Calls Reference Manual
NAME
spt_fputcx - Writes a byte to a specified output stream (thread-aware version)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <stdio.h>]
#include <spthread.h>
int spt_fputcx (
int c,
FILE *stream
);
PARAMETERS
c Specifies the character to be written.
stream Points to the file structure of an open file.
DESCRIPTION
The spt_fputcx( ) function is the thread-aware version of the fputc() function.
The spt_fputcx( ) function writes the character c to the output specified by the stream parameter.
The character is written at the position at which the file pointer is currently pointing, if defined.
With the exception of stderr, output streams are, by default, buffered if they refer to files, or line
buffered if they refer to terminals. The standard error output stream, stderr, is unbuffered by
default, but using the freopen( ) function causes it to become buffered or line buffered. Use the
setbuf() function to change the stream-buffering strategy.
When an output stream is unbuffered, information is queued for writing on the destination file or
terminal as soon as it is written. When an output stream is buffered, many characters are saved
and written as a block. When an output stream is line-buffered, each line of output is queued for
writing on the destination terminal as soon as the line is completed (that is, as soon as a newline
character is written or terminal input is requested).
The st_ctime and st_mtime fields of the file are marked for update between the successful exe-
cution of the spt_fputcx() function, and the next successful completion of a call to the
spt_fflushx() or spt_fclosex( ) function on the same stream, or a call to the exit() or abort()
function.
NOTES
The macro to map fputc( ) to spt_fputcx() is available in C applications when
SPT_THREAD_AWARE_NONBLOCK has been defined in the following manner before
including spthread.h:
#define SPT_THREAD_AWARE_NONBLOCK
The alias to link fputc( ) to spt_fputcx() is available in C++ applications when
SPT_THREAD_AWARE_PRAGMA_NONBLOCK has been defined in the following manner
before including spthread.h:
#define SPT_THREAD_AWARE_PRAGMA_NONBLOCK
The spt_fputcx( ) function is never a macro.
The spt_fputcx( ) function runs more slowly than spt_putcx(), but takes less space per invoca-
tion.
7214 Hewlett-Packard Company 527186-023