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

fsetpos.3p (5028B)


  1. '\" et
  2. .TH FSETPOS "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. fsetpos
  12. \(em set current file position
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stdio.h>
  17. .P
  18. int fsetpos(FILE *\fIstream\fP, const fpos_t *\fIpos\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. \fIfsetpos\fR()
  27. function shall set the file position and state indicators for the
  28. stream pointed to by
  29. .IR stream
  30. according to the value of the object pointed to by
  31. .IR pos ,
  32. which the application shall ensure is a value obtained from an earlier
  33. call to
  34. \fIfgetpos\fR()
  35. on the same stream. If a read or write error occurs, the error
  36. indicator for the stream shall be set and
  37. \fIfsetpos\fR()
  38. fails.
  39. .P
  40. A successful call to the
  41. \fIfsetpos\fR()
  42. function shall clear the end-of-file indicator for the stream and
  43. undo any effects of
  44. \fIungetc\fR()
  45. on the same stream. After an
  46. \fIfsetpos\fR()
  47. call, the next operation on an update stream may be either input or
  48. output.
  49. .P
  50. The behavior of
  51. \fIfsetpos\fR()
  52. on devices which are incapable of seeking is implementation-defined.
  53. The value of the file offset associated with such a device is
  54. undefined.
  55. .P
  56. The
  57. \fIfsetpos\fR()
  58. function shall not change the setting of
  59. .IR errno
  60. if successful.
  61. .SH "RETURN VALUE"
  62. The
  63. \fIfsetpos\fR()
  64. function shall return 0 if it succeeds; otherwise, it shall return
  65. a non-zero value and set
  66. .IR errno
  67. to indicate the error.
  68. .SH ERRORS
  69. The
  70. \fIfsetpos\fR()
  71. function shall fail if,
  72. either the
  73. .IR stream
  74. is unbuffered or the
  75. .IR stream 's
  76. buffer needed to be flushed, and the call to
  77. \fIfsetpos\fR()
  78. causes an underlying
  79. \fIlseek\fR()
  80. or
  81. \fIwrite\fR()
  82. to be invoked, and:
  83. .TP
  84. .BR EAGAIN
  85. The O_NONBLOCK flag is set for the file descriptor and the thread
  86. would be delayed in the write operation.
  87. .TP
  88. .BR EBADF
  89. The file descriptor underlying the stream file is not open for writing
  90. or the stream's buffer needed to be flushed and the file is not open.
  91. .TP
  92. .BR EFBIG
  93. An attempt was made to write a file that exceeds the maximum file size.
  94. .TP
  95. .BR EFBIG
  96. An attempt was made to write a file that exceeds the file size
  97. limit of the process.
  98. .TP
  99. .BR EFBIG
  100. The file is a regular file and an attempt was made to write at or
  101. beyond the offset maximum associated with the corresponding stream.
  102. .TP
  103. .BR EINTR
  104. The write operation was terminated due to the receipt of a signal,
  105. and no data was transferred.
  106. .TP
  107. .BR EIO
  108. A physical I/O error has occurred, or the process is a member of a
  109. background process group attempting to perform a
  110. \fIwrite\fR()
  111. to its controlling terminal, TOSTOP is set, the calling thread is not
  112. blocking SIGTTOU, the process is not ignoring SIGTTOU, and the process
  113. group of the process is orphaned.
  114. This error may also be returned under implementation-defined conditions.
  115. .TP
  116. .BR ENOSPC
  117. There was no free space remaining on the device containing the file.
  118. .TP
  119. .BR EPIPE
  120. An attempt was made to write to a pipe or FIFO that is not open for
  121. reading by any process; a SIGPIPE
  122. signal shall also be sent to the thread.
  123. .TP
  124. .BR ESPIPE
  125. The file descriptor underlying
  126. .IR stream
  127. is associated with a pipe, FIFO, or socket.
  128. .P
  129. The
  130. \fIfsetpos\fR()
  131. function may fail if:
  132. .TP
  133. .BR ENXIO
  134. A request was made of a nonexistent device, or the request was outside
  135. the capabilities of the device.
  136. .LP
  137. .IR "The following sections are informative."
  138. .SH EXAMPLES
  139. None.
  140. .SH "APPLICATION USAGE"
  141. None.
  142. .SH RATIONALE
  143. None.
  144. .SH "FUTURE DIRECTIONS"
  145. None.
  146. .SH "SEE ALSO"
  147. .IR "Section 2.5" ", " "Standard I/O Streams",
  148. .IR "\fIfopen\fR\^(\|)",
  149. .IR "\fIftell\fR\^(\|)",
  150. .IR "\fIlseek\fR\^(\|)",
  151. .IR "\fIrewind\fR\^(\|)",
  152. .IR "\fIungetc\fR\^(\|)",
  153. .IR "\fIwrite\fR\^(\|)"
  154. .P
  155. The Base Definitions volume of POSIX.1\(hy2017,
  156. .IR "\fB<stdio.h>\fP"
  157. .\"
  158. .SH COPYRIGHT
  159. Portions of this text are reprinted and reproduced in electronic form
  160. from IEEE Std 1003.1-2017, Standard for Information Technology
  161. -- Portable Operating System Interface (POSIX), The Open Group Base
  162. Specifications Issue 7, 2018 Edition,
  163. Copyright (C) 2018 by the Institute of
  164. Electrical and Electronics Engineers, Inc and The Open Group.
  165. In the event of any discrepancy between this version and the original IEEE and
  166. The Open Group Standard, the original IEEE and The Open Group Standard
  167. is the referee document. The original Standard can be obtained online at
  168. http://www.opengroup.org/unix/online.html .
  169. .PP
  170. Any typographical or formatting errors that appear
  171. in this page are most likely
  172. to have been introduced during the conversion of the source files to
  173. man page format. To report such errors, see
  174. https://www.kernel.org/doc/man-pages/reporting_bugs.html .