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

ftell.3p (3287B)


  1. '\" et
  2. .TH FTELL "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. ftell,
  12. ftello
  13. \(em return a file offset in a stream
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <stdio.h>
  18. .P
  19. long ftell(FILE *\fIstream\fP);
  20. off_t ftello(FILE *\fIstream\fP);
  21. .fi
  22. .SH DESCRIPTION
  23. The functionality described on this reference page is aligned with the
  24. ISO\ C standard. Any conflict between the requirements described here and the
  25. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  26. .P
  27. The
  28. \fIftell\fR()
  29. function shall obtain the current value of the file-position indicator
  30. for the stream pointed to by
  31. .IR stream .
  32. .P
  33. The
  34. \fIftell\fR()
  35. function shall not change the setting of
  36. .IR errno
  37. if successful.
  38. .P
  39. The
  40. \fIftello\fR()
  41. function shall be equivalent to
  42. \fIftell\fR(),
  43. except that the return value is of type
  44. .BR off_t
  45. and the
  46. \fIftello\fR()
  47. function may change the setting of
  48. .IR errno
  49. if successful.
  50. .SH "RETURN VALUE"
  51. Upon successful completion,
  52. \fIftell\fR()
  53. and
  54. \fIftello\fR()
  55. shall return the current value of the file-position indicator for the
  56. stream measured in bytes from the beginning of the file.
  57. .P
  58. Otherwise,
  59. \fIftell\fR()
  60. and
  61. \fIftello\fR()
  62. shall return \-1, and set
  63. .IR errno
  64. to indicate the error.
  65. .SH ERRORS
  66. The
  67. \fIftell\fR()
  68. and
  69. \fIftello\fR()
  70. functions shall fail if:
  71. .TP
  72. .BR EBADF
  73. The file descriptor underlying
  74. .IR stream
  75. is not an open file descriptor.
  76. .TP
  77. .BR EOVERFLOW
  78. For
  79. \fIftell\fR(),
  80. the current file offset cannot be represented correctly in an object of
  81. type
  82. .BR long .
  83. .TP
  84. .BR EOVERFLOW
  85. For
  86. \fIftello\fR(),
  87. the current file offset cannot be represented correctly in an object of
  88. type
  89. .BR off_t .
  90. .TP
  91. .BR ESPIPE
  92. The file descriptor underlying
  93. .IR stream
  94. is associated with a pipe, FIFO, or socket.
  95. .LP
  96. .IR "The following sections are informative."
  97. .SH EXAMPLES
  98. None.
  99. .SH "APPLICATION USAGE"
  100. None.
  101. .SH RATIONALE
  102. None.
  103. .SH "FUTURE DIRECTIONS"
  104. None.
  105. .SH "SEE ALSO"
  106. .IR "Section 2.5" ", " "Standard I/O Streams",
  107. .IR "\fIfgetpos\fR\^(\|)",
  108. .IR "\fIfopen\fR\^(\|)",
  109. .IR "\fIfseek\fR\^(\|)",
  110. .IR "\fIlseek\fR\^(\|)"
  111. .P
  112. The Base Definitions volume of POSIX.1\(hy2017,
  113. .IR "\fB<stdio.h>\fP"
  114. .\"
  115. .SH COPYRIGHT
  116. Portions of this text are reprinted and reproduced in electronic form
  117. from IEEE Std 1003.1-2017, Standard for Information Technology
  118. -- Portable Operating System Interface (POSIX), The Open Group Base
  119. Specifications Issue 7, 2018 Edition,
  120. Copyright (C) 2018 by the Institute of
  121. Electrical and Electronics Engineers, Inc and The Open Group.
  122. In the event of any discrepancy between this version and the original IEEE and
  123. The Open Group Standard, the original IEEE and The Open Group Standard
  124. is the referee document. The original Standard can be obtained online at
  125. http://www.opengroup.org/unix/online.html .
  126. .PP
  127. Any typographical or formatting errors that appear
  128. in this page are most likely
  129. to have been introduced during the conversion of the source files to
  130. man page format. To report such errors, see
  131. https://www.kernel.org/doc/man-pages/reporting_bugs.html .