Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) spt_putsx(2)
NAME
spt_putsx - Writes a string to the standard 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_putsx (
const char *string
);
PARAMETERS
string Points to a string to be written to output.
DESCRIPTION
The spt_putsx() function is the thread-aware version of the puts() function.
The spt_putsx() function writes the null-terminated string pointed to by the string parameter,
followed by a newline character, to the standard output stream, stdout. This function does not
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_putsx() 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 puts( ) to spt_xputs() 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 puts() to spt_putsx() 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_putsx() function returns the number of characters written.
This function can return EOF on an error.
If the file descriptor underlying stdout 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
and is not blocked, ignored, or handled, EOF is returned with an errno value of [EINTR].
ERRORS
The spt_putsx() function fails if either:
• The standard output stream is unbuffered.
• The buffer for the standard output stream needs to be flushed and the function call caused
an underlying spt_writex() or lseek() to be invoked and this underlying operation fails
with incomplete output.
527186-023 Hewlett-Packard Company 7−315