Open System Services System Calls Reference Manual (G06.28+)

spt_putwx(2) OSS System Calls Reference Manual
NAME
spt_putwx - Writes a word to a 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_putwx (
int w,
FILE *stream
);
PARAMETERS
stream Points to the le structure of an open le.
w Species the word to be written.
DESCRIPTION
The spt_putwx() function is the thread-aware version of the putw() function.
The spt_putwx() function writes the word (int) specied by the w parameter to the output
specied by the stream parameter. The word is written at the position at which the le pointer, if
dened, is pointing. The size of a word is the size of an integer and varies from machine to
machine. The spt_putwx() function does not assume or cause special alignment of the data in
the le.
Because of possible differences in word length and byte ordering, les written using the
spt_putwx() function are machine dependent, and may not be readable using the spt_getwx()
function on a different processor.
With the exception of stderr, output streams are, by default, buffered if they refer to les, 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 le 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 elds of the le are marked for update between the successful exe-
cution of the spt_putwx( ), function, and the next successful completion of a call to the
spt_fushx( ) or spt_fclosex() function on the same stream, or a call to the exit() or abort()
function.
NOTES
The macro to map putw() to spt_putwx() is available in C applications when
SPT_THREAD_AWARE_NONBLOCK has been dened in the following manner before
including spthread.h:
#dene SPT_THREAD_AWARE_NONBLOCK
The alias to link putw() to spt_putwx() is available in C++ applications when
SPT_THREAD_AWARE_PRAGMA_NONBLOCK has been dened in the following manner
before including spthread.h:
7234 Hewlett-Packard Company 527186-005