logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

fputc.3p (4684B)


  1. '\" et
  2. .TH FPUTC "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. fputc
  12. \(em put a byte on a stream
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stdio.h>
  17. .P
  18. int fputc(int \fIc\fP, FILE *\fIstream\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The functionality described on this reference page is aligned with the
  22. ISO\ C standard. Any conflict between the requirements described here and the
  23. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  24. .P
  25. The
  26. \fIfputc\fR()
  27. function shall write the byte specified by
  28. .IR c
  29. (converted to an
  30. .BR "unsigned char" )
  31. to the output stream pointed to by
  32. .IR stream ,
  33. at the position indicated by the associated file-position indicator for
  34. the stream (if defined), and shall advance the indicator appropriately.
  35. If the file cannot support positioning requests, or if the stream was
  36. opened with append mode, the byte shall be appended to the output
  37. stream.
  38. .P
  39. The last data modification and last file status change timestamps
  40. of the file shall be marked for update between the successful
  41. execution of
  42. \fIfputc\fR()
  43. and the next successful completion of a call to
  44. \fIfflush\fR()
  45. or
  46. \fIfclose\fR()
  47. on the same stream or a call to
  48. \fIexit\fR()
  49. or
  50. \fIabort\fR().
  51. .SH "RETURN VALUE"
  52. Upon successful completion,
  53. \fIfputc\fR()
  54. shall return the value it has written. Otherwise, it shall return EOF,
  55. the error indicator for the stream shall be set,
  56. and
  57. .IR errno
  58. shall be set to indicate the error.
  59. .SH ERRORS
  60. The
  61. \fIfputc\fR()
  62. function shall fail if either the
  63. .IR stream
  64. is unbuffered or the
  65. .IR stream 's
  66. buffer needs to be flushed, and:
  67. .TP
  68. .BR EAGAIN
  69. The O_NONBLOCK flag is set for the file descriptor underlying
  70. .IR stream
  71. and the thread would be delayed in the write operation.
  72. .TP
  73. .BR EBADF
  74. The file descriptor underlying
  75. .IR stream
  76. is not a valid file descriptor open for writing.
  77. .TP
  78. .BR EFBIG
  79. An attempt was made to write to a file that exceeds the maximum file
  80. size.
  81. .TP
  82. .BR EFBIG
  83. An attempt was made to write to a file that exceeds the file
  84. size limit of the process.
  85. .TP
  86. .BR EFBIG
  87. The file is a regular file and an attempt was made to write at or
  88. beyond the offset maximum.
  89. .TP
  90. .BR EINTR
  91. The write operation was terminated due to the receipt of a signal, and
  92. no data was transferred.
  93. .TP
  94. .BR EIO
  95. A physical I/O error has occurred, or the process is a member of a
  96. background process group attempting to write to its controlling terminal,
  97. TOSTOP is set, the calling thread is not blocking SIGTTOU, the process
  98. is not ignoring SIGTTOU, and the process group of the process is orphaned.
  99. This error may also be returned under implementation-defined conditions.
  100. .TP
  101. .BR ENOSPC
  102. There was no free space remaining on the device containing the file.
  103. .TP
  104. .BR EPIPE
  105. An attempt is made to write to a pipe or FIFO that is not open for
  106. reading by any process. A SIGPIPE signal shall also be sent to the
  107. thread.
  108. .br
  109. .P
  110. The
  111. \fIfputc\fR()
  112. function may fail if:
  113. .TP
  114. .BR ENOMEM
  115. Insufficient storage space is available.
  116. .TP
  117. .BR ENXIO
  118. A request was made of a nonexistent device, or the request was
  119. outside the capabilities of the device.
  120. .LP
  121. .IR "The following sections are informative."
  122. .SH EXAMPLES
  123. None.
  124. .SH "APPLICATION USAGE"
  125. None.
  126. .SH RATIONALE
  127. None.
  128. .SH "FUTURE DIRECTIONS"
  129. None.
  130. .SH "SEE ALSO"
  131. .IR "Section 2.5" ", " "Standard I/O Streams",
  132. .IR "\fIferror\fR\^(\|)",
  133. .IR "\fIfopen\fR\^(\|)",
  134. .IR "\fIgetrlimit\fR\^(\|)",
  135. .IR "\fIputc\fR\^(\|)",
  136. .IR "\fIputs\fR\^(\|)",
  137. .IR "\fIsetbuf\fR\^(\|)",
  138. .IR "\fIulimit\fR\^(\|)"
  139. .P
  140. The Base Definitions volume of POSIX.1\(hy2017,
  141. .IR "\fB<stdio.h>\fP"
  142. .\"
  143. .SH COPYRIGHT
  144. Portions of this text are reprinted and reproduced in electronic form
  145. from IEEE Std 1003.1-2017, Standard for Information Technology
  146. -- Portable Operating System Interface (POSIX), The Open Group Base
  147. Specifications Issue 7, 2018 Edition,
  148. Copyright (C) 2018 by the Institute of
  149. Electrical and Electronics Engineers, Inc and The Open Group.
  150. In the event of any discrepancy between this version and the original IEEE and
  151. The Open Group Standard, the original IEEE and The Open Group Standard
  152. is the referee document. The original Standard can be obtained online at
  153. http://www.opengroup.org/unix/online.html .
  154. .PP
  155. Any typographical or formatting errors that appear
  156. in this page are most likely
  157. to have been introduced during the conversion of the source files to
  158. man page format. To report such errors, see
  159. https://www.kernel.org/doc/man-pages/reporting_bugs.html .