Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fputs_unloc(3S) — HP-UX 10.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ferror(3S)

flockfile(3S)

fopen(3S)

fread(3S)

printf(3S)

putc(3S)

puts(3S)

NAME

puts(), puts_unlocked(), fputs(), fputs_unlocked() − put a string on a stream

SYNOPSIS

#include <stdio.h>

int puts(const char *s);

int puts_unlocked(const char *s);

int fputs(const char *s, FILE *stream);

int fputs_unlocked(const char *s, FILE *stream);

DESCRIPTION

puts() writes the null-terminated string pointed to by s, followed by a new-line character, to the standard output stream stdout. 

fputs() writes the null-terminated string pointed to by s to the named output stream, but does not append a new-line character. 

Neither function writes the terminating null character. 

puts_unlocked() and fputs_unlocked() are identical to puts() and fputs(); respectively, except they do not perform any internal locking of the stream for multi-thread applications.  The _unlocked routines can be used by multi-thread applications which have already used flockfile() to acquire a mutual exclusion lock for the stream (see flockfile(3S)).

RETURN VALUE

Upon successful completion, these routines return a non-negative number.  Otherwise they return EOF, set the error indicator for the stream, and set errno to indicate the error. 

ERRORS

These routines fail if, either the stream is unbuffered or stream’s buffer needed to be flushed causing an underlying write() call to be invoked, and:

[EAGAIN] The O_NONBLOCK flag is set for the file descriptor underlying stream and the process would be delayed in the write operation. 

[EBADF] The file descriptor underlying 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 (see ulimit(2)).

[EINTR] A signal was caught during the write() system call. 

[EIO] The process is in a background process group and is attempting to write to its controlling terminal, TOSTOP is set, the process is neither ignoring nor blocking the SIGTTOU signal, and the process group of the process is orphaned. 

[ENOSPC] There was no free space remaining on the device containing the file. 

[EPIPE] An attempt is made to write to a pipe or FIFO that is not open for reading by any process.  A SIGPIPE signal is also sent to the process. 

Additional errno values may be set by the underlying write() function (see write(2)). 

SEE ALSO

ferror(3S), flockfile(3S), fopen(3S), fread(3S), printf(3S), putc(3S). 

NOTES

puts() and puts_unlocked() append a new-line character; fputs() and fputs_unlocked() do not. 

STANDARDS CONFORMANCE

puts(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C

fputs(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C

Hewlett-Packard Company  —  HP-UX Release 10.20:  July 1996

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026