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

System Functions (s and S) spt_fputsx(2)
NAME
spt_fputsx - Writes a string 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_fputsx (
const char *string,
FILE *stream
);
PARAMETERS
string Points to a string to be written to output.
stream Points to the FILE structure of an open le.
DESCRIPTION
The spt_fputsx() function is the thread-aware version of the fputs() function.
The spt_fputsx() function writes the null-terminated string pointed to by the string parameter to
the output stream specied by the stream parameter. The spt_fputsx() function does not append
a newline character or write the terminating null byte.
The st_ctime and st_mtime elds of the le are marked for update between the successful exe-
cution of the spt_fputsx() function, and the next successful completion of a call to the
spt_fush() or spt_fclose() function on the same stream, or a call to the exit() or abort() func-
tion.
NOTES
The macro to map fputs() to spt_fputsx() 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 fputs( ) to spt_fputsx() is available in C++ applications when
SPT_THREAD_AWARE_PRAGMA_NONBLOCK has been dened in the following manner
before including spthread.h:
#dene SPT_THREAD_AWARE_PRAGMA_NONBLOCK
RETURN VALUES
Upon successful completion, the spt_fputsx() function returns the number of characters written.
This function can return EOF on an error.
If the le descriptor underlying stream becomes invalid (is closed by another thread), EOF is
returned with an errno value of [EBADF]. If a signal is received via the pthread_kill() function
that is not blocked, ignored, or handled, EOF is returned with an errno value of [EINTR].
ERRORS
The spt_fputsx() function fails if either the stream is unbuffered, or the streams buffer needed
to be ushed and the function call caused an underlying spt_writex() or lseek() to be invoked
and this underlying operation fails with incomplete output. In addition, if any of the following
conditions occur, the spt_fputsx() function sets errno to the corresponding value:
527186-005 Hewlett-Packard Company 7165