1FPUTWC(P) POSIX Programmer's Manual FPUTWC(P)
2
3
4
6 fputwc - put a wide-character code on a stream
7
9 #include <stdio.h>
10 #include <wchar.h>
11
12 wint_t fputwc(wchar_t wc, FILE *stream);
13
14
16 The fputwc() function shall write the character corresponding to the
17 wide-character code wc to the output stream pointed to by stream, at
18 the position indicated by the associated file-position indicator for
19 the stream (if defined), and advances the indicator appropriately. If
20 the file cannot support positioning requests, or if the stream was
21 opened with append mode, the character is appended to the output
22 stream. If an error occurs while writing the character, the shift state
23 of the output file is left in an undefined state.
24
25 The st_ctime and st_mtime fields of the file shall be marked for update
26 between the successful execution of fputwc() and the next successful
27 completion of a call to fflush() or fclose() on the same stream or a
28 call to exit() or abort().
29
31 Upon successful completion, fputwc() shall return wc. Otherwise, it
32 shall return WEOF, the error indicator for the stream shall be set,
33 and errno shall be set to indicate the error.
34
36 The fputwc() function shall fail if either the stream is unbuffered or
37 data in the stream's buffer needs to be written, and:
38
39 EAGAIN The O_NONBLOCK flag is set for the file descriptor underlying
40 stream and the process would be delayed in the write operation.
41
42 EBADF The file descriptor underlying stream is not a valid file
43 descriptor open for writing.
44
45 EFBIG An attempt was made to write to a file that exceeds the maximum
46 file size or the process' file size limit.
47
48 EFBIG The file is a regular file and an attempt was made to write at
49 or beyond the offset maximum associated with the corresponding
50 stream.
51
52 EILSEQ The wide-character code wc does not correspond to a valid char‐
53 acter.
54
55 EINTR The write operation was terminated due to the receipt of a sig‐
56 nal, and no data was transferred.
57
58 EIO A physical I/O error has occurred, or the process is a member of
59 a background process group attempting to write to its control‐
60 ling terminal, TOSTOP is set, the process is neither ignoring
61 nor blocking SIGTTOU, and the process group of the process is
62 orphaned. This error may also be returned under implementation-
63 defined conditions.
64
65 ENOSPC There was no free space remaining on the device containing the
66 file.
67
68 EPIPE An attempt is made to write to a pipe or FIFO that is not open
69 for reading by any process. A SIGPIPE signal shall also be sent
70 to the thread.
71
72
73 The fputwc() function may fail if:
74
75 ENOMEM Insufficient storage space is available.
76
77 ENXIO A request was made of a nonexistent device, or the request was
78 outside the capabilities of the device.
79
80
81 The following sections are informative.
82
84 None.
85
87 None.
88
90 None.
91
93 None.
94
96 ferror() , fopen() , setbuf() , ulimit() , the Base Definitions volume
97 of IEEE Std 1003.1-2001, <stdio.h>, <wchar.h>
98
100 Portions of this text are reprinted and reproduced in electronic form
101 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
102 -- Portable Operating System Interface (POSIX), The Open Group Base
103 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
104 Electrical and Electronics Engineers, Inc and The Open Group. In the
105 event of any discrepancy between this version and the original IEEE and
106 The Open Group Standard, the original IEEE and The Open Group Standard
107 is the referee document. The original Standard can be obtained online
108 at http://www.opengroup.org/unix/online.html .
109
110
111
112IEEE/The Open Group 2003 FPUTWC(P)