putwc(3C)putwc(3C)NAMEputwc(), putwchar(), fputwc() - put a wide character on a stream file
These functions are compliant with the XPG4 Worldwide Portability
Interface wide-character I/O functions. They parallel the 8-bit char‐
acter I/O functions defined in putc(3S).
Writes the character corresponding to the wide character
wc onto the output stream at the position where the file
pointer is pointing. is defined as and are defined both
as macros and as functions.
Behaves like but is a function rather than a macro, and can therefore
be used as an argument.
Output streams, with the exception of the standard error stream are by
default buffered if the output refers to a file and line-buffered if
the output refers to a terminal. The standard error output stream, is
by default unbuffered, but use of (see fopen(3S)) causes it to become
buffered or line-buffered. or (see setbuf(3S)) can be used to change
the stream's buffering strategy.
Definitions for these functions, the type wint_t and the value WEOF are
provided in the header.
and put a wide character on a stream file.
To use the prototype, the flag must be passed as a compiler option or
defined as a macro in source files.
After or is applied to a stream, the stream becomes byte-oriented (see
The category determines how wide character conversions are done.
International Code Set Support
Single- and multi-byte character code sets are supported.
On success, and each return the wide character corresponding to the
value they have written. On failure, they return the constant set the
error indicator for the stream, and set to indicate the error.
and fail if either the stream is unbuffered, or stream's buffer needed
to be flushed causing an underlying call to be invoked, and:
[EAGAIN] The flag is set for the file descriptor underly‐
ing 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 max‐
imum file size (see ulimit(2)).
[EINTR] A signal was caught during the system call.
[EIO] A physical I/O error has occurred, or the process
is in a background process group and is attempt‐
ing to write to its controlling terminal, is set,
the process is neither ignoring nor blocking the
signal, and the process group of the process is
[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
signal is also sent to the process.
[EILSEQ] The wide character wc does not correspond to a
Additional values can be set by the underlying function (see write(2)).
Line buffering may cause confusion or malfunctioning of programs that
use wide character I/O routines but use themselves to read from stan‐
dard input. When a large amount of computation is done after printing
part of a line on an output terminal, it is necessary to (see
fclose(3S)) the standard output before beginning the computation.
and are obsolescent interfaces supported only for compatibility with
existing DCE applications. New multithreaded applications should use
was developed by OSF and HP.
SEE ALSOfclose(3S), ferror(3S), flockfile(3S), fopen(3S), getwc(3C), fread(3S),
printf(3S), putws(3C), setbuf(3S), orientation(5), thread_safety(5).