HP-UX Reference (11i v1 00/12) - 3 Library Functions N-Z (vol 7)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/nan.3m
________________________________________________________________
___ ___
p
putwc(3C) putwc(3C)
RETURN VALUE
On success, putwc(), putwc_unlocked(), fputwc(), fputwc_unlocked(), putwchar() ,
and putwchar_unlocked() each return the wide character corresponding to the value they have writ-
ten. On failure, they return the constant WEOF, set the error indicator for the stream, and set errno to
indicate the error.
ERRORS
putwc(), putwc_unlocked(), putwchar(), putwchar_unlocked(), fputwc(), and
fputwc_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 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] A physical I/O error has occurred, or the process is in a background process group and
is attempting to write to its controlling terminal,
TOSTOP is set, the process is nei-
ther 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 pro-
cess. A SIGPIPE signal is also sent to the process.
[EILSEQ] The wide character wc does not correspond to a valid character.
Additional errno values can be set by the underlying write() function (see write(2)).
WARNINGS
Line buffering may cause confusion or malfunctioning of programs that use wide character I/O routines but
use
read() themselves to read from standard input. When a large amount of computation is done after
printing part of a line on an output terminal, it is necessary to fflush() (see fclose(3S)) the standard
output before beginning the computation.
putwc_unlocked(),
putwchar_unlocked() and fputwc_unlocked()
are obsolescent inter-
faces supported only for compatibility with existing DCE applications. New multithreaded applications
should use
putwc(), putwchar() and fputwc().
AUTHOR
putwc() was developed by OSF and HP.
SEE ALSO
fclose(3S), ferror(3S), flockfile(3S), fopen(3S), getwc(3C), fread(3S), printf(3S), putws(3C), setbuf(3S), orien-
tation(5).
STANDARDS CONFORMANCE
putwc(): XPG4
fputwc(): XPG4
putwchar(): XPG4
Section 3738 2 HP-UX Release 11i: December 2000
___
___