1FPUTWC(3P)                 POSIX Programmer's Manual                FPUTWC(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       fputwc — put a wide-character code on a stream
14

SYNOPSIS

16       #include <stdio.h>
17       #include <wchar.h>
18
19       wint_t fputwc(wchar_t wc, FILE *stream);
20

DESCRIPTION

22       The functionality described on this reference page is aligned with  the
23       ISO C  standard.  Any  conflict between the requirements described here
24       and the ISO C standard is unintentional. This  volume  of  POSIX.1‐2008
25       defers to the ISO C standard.
26
27       The  fputwc()  function  shall write the character corresponding to the
28       wide-character code wc to the output stream pointed to  by  stream,  at
29       the  position  indicated  by the associated file-position indicator for
30       the stream (if defined), and advances the indicator  appropriately.  If
31       the  file  cannot  support  positioning  requests, or if the stream was
32       opened with append mode,  the  character  is  appended  to  the  output
33       stream. If an error occurs while writing the character, the shift state
34       of the output file is left in an undefined state.
35
36       The last data modification and last file status  change  timestamps  of
37       the file shall be marked for update between the successful execution of
38       fputwc() and the next successful completion of a call  to  fflush()  or
39       fclose() on the same stream or a call to exit() or abort().
40
41       The fputwc() function shall not change the setting of errno if success‐
42       ful.
43

RETURN VALUE

45       Upon successful completion, fputwc() shall return  wc.   Otherwise,  it
46       shall return WEOF, the error indicator for the stream shall be set, and
47       errno shall be set to indicate the error.
48

ERRORS

50       The fputwc() function shall fail if either the stream is unbuffered  or
51       data in the stream's buffer needs to be written, and:
52
53       EAGAIN The  O_NONBLOCK  flag  is set for the file descriptor underlying
54              stream and the thread would be delayed in the write operation.
55
56       EBADF  The file descriptor  underlying  stream  is  not  a  valid  file
57              descriptor open for writing.
58
59       EFBIG  An  attempt was made to write to a file that exceeds the maximum
60              file size or the file size limit of the process.
61
62       EFBIG  The file is a regular file and an attempt was made to  write  at
63              or  beyond  the offset maximum associated with the corresponding
64              stream.
65
66       EILSEQ The wide-character code wc does not correspond to a valid  char‐
67              acter.
68
69       EINTR  The  write operation was terminated due to the receipt of a sig‐
70              nal, and no data was transferred.
71
72       EIO    A physical I/O error has occurred, or the process is a member of
73              a  background  process group attempting to write to its control‐
74              ling terminal, TOSTOP is set, the calling thread is not blocking
75              SIGTTOU,  the  process  is not ignoring SIGTTOU, and the process
76              group of the process  is  orphaned.   This  error  may  also  be
77              returned under implementation-defined conditions.
78
79       ENOSPC There  was  no free space remaining on the device containing the
80              file.
81
82       EPIPE  An attempt is made to write to a pipe or FIFO that is  not  open
83              for  reading by any process. A SIGPIPE signal shall also be sent
84              to the thread.
85
86       The fputwc() function may fail if:
87
88       ENOMEM Insufficient storage space is available.
89
90       ENXIO  A request was made of a nonexistent device, or the  request  was
91              outside the capabilities of the device.
92
93       The following sections are informative.
94

EXAMPLES

96       None.
97

APPLICATION USAGE

99       None.
100

RATIONALE

102       None.
103

FUTURE DIRECTIONS

105       None.
106

SEE ALSO

108       Section   2.5,  Standard  I/O  Streams,  ferror(),  fopen(),  setbuf(),
109       ulimit()
110
111       The Base Definitions volume of POSIX.1‐2008, <stdio.h>, <wchar.h>
112
114       Portions of this text are reprinted and reproduced in  electronic  form
115       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
116       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
117       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
118       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
119       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
120       event of any discrepancy between this version and the original IEEE and
121       The  Open Group Standard, the original IEEE and The Open Group Standard
122       is the referee document. The original Standard can be  obtained  online
123       at http://www.unix.org/online.html .
124
125       Any  typographical  or  formatting  errors that appear in this page are
126       most likely to have been introduced during the conversion of the source
127       files  to  man page format. To report such errors, see https://www.ker
128       nel.org/doc/man-pages/reporting_bugs.html .
129
130
131
132IEEE/The Open Group                  2013                           FPUTWC(3P)
Impressum