Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
spt_fputsx(2) OSS System Calls Reference Manual
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 file.
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 specified 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 fields of the file 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_fflush() 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 defined in the following manner before
including spthread.h:
#define 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 defined in the following manner
before including spthread.h:
#define 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 file 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
• The buffer of the stream needs to be flushed and the function call causes an underlying
spt_writex() or lseek() to be invoked and this underlying operation fails with
7−218 Hewlett-Packard Company 527186-023