Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) spt_putcharx(2)
RETURN VALUES
The spt_putcharx() function and macro, upon successful completion, return the value written.
If this function or macro fails, it returns the constant EOF. The function sets errno when an error
is encountered.
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_putcharx() function fails if:
• The standard output stream is not open for writing.
• The output file size cannot be increased.
•
The standard output stream is unbuffered.
• The buffer of the standard output stream needs to be flushed and the function call causes
an underlying spt_writex() or lseek() to be invoked and this underlying operation fails.
In addition, if any of these conditions occur, the spt_putcharx() function sets errno to the
corresponding value:
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor underlying the output
stream and the process would be delayed in the write operation.
[EBADF] The file descriptor underlying the output stream is not a valid file descriptor open
for writing.
[EFBIG] An attempt was made to write to a file that exceeds the process’s file size limit or
the maximum file size.
[EINTR] The write operation was interrupted by a signal that was caught, and no data was
transferred.
[EIO] The implementation supports job control; the process is a member of a back-
ground process group attempting to write to its controlling terminal; TOSTOP is
set; the process is neither ignoring nor blocking SIGTTOU; and the process
group of the process is orphaned. This error might also be returned under
implementation-defined conditions.
[ENOMEM] Insufficient memory storage space is available.
[ENOSPC] No free space was remaining on the device containing the file.
[ENXIO] A request was made of a nonexistent device, or the request was outside the capa-
bilities of the device.
[EPIPE] An attempt was made to write to a pipe or FIFO that is not open for reading by
any process. A SIGPIPE signal will also be sent to the process.
Any error encountered during the underlying call to the spt_writex() function can cause this
function to return the corresponding errno value reported by the spt_writex() function. If your
application program encounters an errno value not listed on this reference page, see the the
spt_writex(2) reference page either online or in the Open System Services System Calls Refer-
ence Manual for information about the cause of that error.
527186-023 Hewlett-Packard Company 7−309