FPUTC(3)                   POSIX Programmer's Manual                  FPUTC(3)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.


NNAAMMEE
       fputc -- put a byte on a stream

SSYYNNOOPPSSIISS
       #include <stdio.h>

       int fputc(int _c, FILE *_s_t_r_e_a_m);

DDEESSCCRRIIPPTTIIOONN
       The functionality described on this reference page is aligned with the
       ISO C standard. Any conflict between the requirements described here
       and the ISO C standard is unintentional. This volume of POSIX.1-2008
       defers to the ISO C standard.

       The _f_p_u_t_c() function shall write the byte specified by _c (converted to
       an uunnssiiggnneedd cchhaarr) to the output stream pointed to by _s_t_r_e_a_m, at the
       position indicated by the associated file-position indicator for the
       stream (if defined), and shall advance the indicator appropriately.  If
       the file cannot support positioning requests, or if the stream was
       opened with append mode, the byte shall be appended to the output
       stream.

       The last data modification and last file status change timestamps of
       the file shall be marked for update between the successful execution of
       _f_p_u_t_c() and the next successful completion of a call to _f_f_l_u_s_h() or
       _f_c_l_o_s_e() on the same stream or a call to _e_x_i_t() or _a_b_o_r_t().

RREETTUURRNN VVAALLUUEE
       Upon successful completion, _f_p_u_t_c() shall return the value it has
       written. Otherwise, it shall return EOF, the error indicator for the
       stream shall be set, and _e_r_r_n_o shall be set to indicate the error.

EERRRROORRSS
       The _f_p_u_t_c() function shall fail if either the _s_t_r_e_a_m is unbuffered or
       the _s_t_r_e_a_m's buffer needs to be flushed, and:

       EEAAGGAAIINN The O_NONBLOCK flag is set for the file descriptor underlying
              _s_t_r_e_a_m and the thread would be delayed in the write operation.

       EEBBAADDFF  The file descriptor underlying _s_t_r_e_a_m is not a valid file
              descriptor open for writing.

       EEFFBBIIGG  An attempt was made to write to a file that exceeds the maximum
              file size.

       EEFFBBIIGG  An attempt was made to write to a file that exceeds the file
              size limit of the process.

       EEFFBBIIGG  The file is a regular file and an attempt was made to write at
              or beyond the offset maximum.

       EEIINNTTRR  The write operation was terminated due to the receipt of a
              signal, and no data was transferred.

       EEIIOO    A physical I/O error has occurred, or the process is a member of
              a background process group attempting to write to its
              controlling terminal, TOSTOP is set, the calling thread is not
              blocking SIGTTOU, the process is not ignoring SIGTTOU, and the
              process group of the process is orphaned.  This error may also
              be returned under implementation-defined conditions.

       EENNOOSSPPCC There was no free space remaining on the device containing the
              file.

       EEPPIIPPEE  An attempt is made to write to a pipe or FIFO that is not open
              for reading by any process. A SIGPIPE signal shall also be sent
              to the thread.

       The _f_p_u_t_c() function may fail if:

       EENNOOMMEEMM Insufficient storage space is available.

       EENNXXIIOO  A request was made of a nonexistent device, or the request was
              outside the capabilities of the device.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

EEXXAAMMPPLLEESS
       None.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       None.

RRAATTIIOONNAALLEE
       None.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _S_e_c_t_i_o_n _2_._5, _S_t_a_n_d_a_r_d _I_/_O _S_t_r_e_a_m_s, _f_e_r_r_o_r(), _f_o_p_e_n(), _g_e_t_r_l_i_m_i_t(),
       _p_u_t_c(), _p_u_t_s(), _s_e_t_b_u_f(), _u_l_i_m_i_t()

       The Base Definitions volume of POSIX.1-2008, <<ssttddiioo..hh>>

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
       -- Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, Copyright (C) 2013 by the Institute of
       Electrical and Electronics Engineers, Inc and The Open Group.  (This is
       POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
       event of any discrepancy between this version and the original IEEE and
       The Open Group Standard, the original IEEE and The Open Group Standard
       is the referee document. The original Standard can be obtained online
       at http://www.unix.org/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2013                             FPUTC(3)
