putws.3c (2010 09)
p
putws(3C) putws(3C)
NAME
putws( ), fputws( ) - put a wide character string on a stream file
SYNOPSIS
#include <wchar.h>
int putws(const wchar_t *ws);
int fputws(const wchar_t *__restrict ws, FILE *__restrict stream);
Obsolescent Interfaces
int putws_unlocked(const wchar_t *ws);
int fputws_unlocked(const wchar_t *ws, FILE *stream);
Remarks:
fputws is compliant with the XPG4 Worldwide Portability Interface wide-character I/O functions.
These functions parallel the 8 bit character I/O functions defined in puts(3S).
DESCRIPTION
putws() writes a character string corresponding to the null-terminated wide-character string pointed to
by ws followed by a new-line character, to the standard output stream stdout.
fputws() writes a character string corresponding to the null-terminated wide-character string pointed
to by ws to the named output stream , but does not append a new-line character or a terminating null
character.
Neither function writes a terminating null character.
The definition for these functions, the type
wchar_t and the value WEOF are provided in the
<wchar.h>header.
Obsolescent Interfaces
putws_unlocked() and
fputws_unlocked() put a wide character string on a stream file.
APPLICATION USAGE
After
putws() or fputws() is applied to a stream, the stream becomes wide-oriented (see orienta-
tion (5)).
EXTERNAL INFLUENCES
Locale
The
LC_CTYPE category determines how wide character conversions are done.
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
Upon successful completion,
putws(), putws_unlocked(), fputws(), and fputws_unlocked()
return a non-negative number. Otherwise they return WEOF, set the error indicator for the stream, and
set errno to indicate the error.
ERRORS
putws(), putws_unlocked(), fputws(), and fputws_unlocked()
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 pro-
cess 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 con-
trolling terminal,
TOSTOP is set, the process is neither ignoring nor blocking the
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1