Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

puts(3) OSS Library Calls Reference Manual
NAME
puts - Writes a string to the standard output stream
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <stdio.h>
int puts(
const char *string);
PARAMETERS
string Points to a string to be written to output.
DESCRIPTION
The puts( ) 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 puts( ) function, and the next successful completion of a call to the fush( ) or
fclose( ) function on the same stream, or a call to the exit( ) or abort( ) function.
RETURN VALUES
Upon successful completion, the puts( ) function returns the number of characters written. This
function can return EOF on an error.
ERRORS
The puts( ) function fails if either the standard output stream is unbuffered, or the stream’s buffer
needed to be flushed and the function call caused an underlying write( ) or lseek( ) to be invoked
and this underlying operation fails with incomplete output. In addition, if any of the following
conditions occur, the puts( ) function sets errno to the corresponding value:
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor of the underlying stream
and the process would be delayed in the write operation.
[EBADF] The file descriptor of the underlying stream is not a valid file descriptor open for
writing.
[EFBIG] An attempt was made to write at or beyond the file offset maximum.
[EINTR] The read 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.
594 Hewlett-Packard Company 527187-017