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

stdio.h.0p (10026B)


  1. '\" et
  2. .TH stdio.h "0P" 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. stdio.h
  12. \(em standard buffered input/output
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stdio.h>
  17. .fi
  18. .SH DESCRIPTION
  19. Some of the functionality described on this reference page extends the
  20. ISO\ C standard. Applications shall define the appropriate feature test macro
  21. (see the System Interfaces volume of POSIX.1\(hy2017,
  22. .IR "Section 2.2" ", " "The Compilation Environment")
  23. to enable the visibility of these symbols in this header.
  24. .P
  25. The
  26. .IR <stdio.h>
  27. header shall define the following data types through
  28. .BR typedef :
  29. .IP "\fBFILE\fP" 14
  30. A structure containing information about a file.
  31. .IP "\fBfpos_t\fP" 14
  32. A non-array type containing all information needed to specify uniquely
  33. every position within a file.
  34. .IP "\fBoff_t\fP" 14
  35. As described in
  36. .IR <sys/types.h> .
  37. .IP "\fBsize_t\fP" 14
  38. As described in
  39. .IR <stddef.h> .
  40. .IP "\fBssize_t\fP" 14
  41. As described in
  42. .IR <sys/types.h> .
  43. .IP "\fBva_list\fP" 14
  44. As described in
  45. .IR <stdarg.h> .
  46. .P
  47. The
  48. .IR <stdio.h>
  49. header shall define the following macros which shall expand to
  50. integer constant expressions:
  51. .IP BUFSIZ 14
  52. Size of
  53. .IR <stdio.h>
  54. buffers.
  55. This shall expand to a positive value.
  56. .IP L_ctermid 14
  57. Maximum size of character array to hold
  58. \fIctermid\fR()
  59. output.
  60. .IP L_tmpnam 14
  61. Maximum size of character array to hold
  62. \fItmpnam\fR()
  63. output.
  64. .P
  65. The
  66. .IR <stdio.h>
  67. header shall define the following macros which shall expand to
  68. integer constant expressions with distinct values:
  69. .IP _IOFBF 14
  70. Input/output fully buffered.
  71. .IP _IOLBF 14
  72. Input/output line buffered.
  73. .IP _IONBF 14
  74. Input/output unbuffered.
  75. .P
  76. The
  77. .IR <stdio.h>
  78. header shall define the following macros which shall expand to
  79. integer constant expressions with distinct values:
  80. .IP SEEK_CUR 14
  81. Seek relative to current position.
  82. .IP SEEK_END 14
  83. Seek relative to end-of-file.
  84. .IP SEEK_SET 14
  85. Seek relative to start-of-file.
  86. .P
  87. The
  88. .IR <stdio.h>
  89. header shall define the following macros which shall expand to
  90. integer constant expressions denoting implementation limits:
  91. .IP {FILENAME_MAX} 14
  92. Maximum size in bytes of the longest pathname that the implementation
  93. guarantees can be opened.
  94. .IP {FOPEN_MAX} 14
  95. Number of streams which the implementation guarantees can be open
  96. simultaneously. The value is at least eight.
  97. .IP {TMP_MAX} 14
  98. Minimum number of unique filenames generated by
  99. \fItmpnam\fR().
  100. Maximum number of times an application can call
  101. \fItmpnam\fR()
  102. reliably. The value of
  103. {TMP_MAX}
  104. is at least 25.
  105. .RS 14
  106. .P
  107. On XSI-conformant systems, the value of
  108. {TMP_MAX}
  109. is at least 10\|000.
  110. .RE
  111. .P
  112. The
  113. .IR <stdio.h>
  114. header shall define the following macro which shall expand to an integer
  115. constant expression with type
  116. .BR int
  117. and a negative value:
  118. .IP EOF 14
  119. End-of-file return value.
  120. .P
  121. The
  122. .IR <stdio.h>
  123. header shall define NULL as described in
  124. .IR <stddef.h> .
  125. .br
  126. .P
  127. The
  128. .IR <stdio.h>
  129. header shall define the following macro which shall expand to a
  130. string constant:
  131. .IP P_tmpdir 14
  132. Default directory prefix for
  133. \fItempnam\fR().
  134. .P
  135. The
  136. .IR <stdio.h>
  137. header shall define the following macros which shall expand to
  138. expressions of type ``pointer to
  139. .BR FILE ''
  140. that point to the
  141. .BR FILE
  142. objects associated, respectively, with the standard error, input, and
  143. output streams:
  144. .IP "\fIstderr\fR" 14
  145. Standard error output stream.
  146. .IP "\fIstdin\fR" 14
  147. Standard input stream.
  148. .IP "\fIstdout\fR" 14
  149. Standard output stream.
  150. .P
  151. The following shall be declared as functions and may also be defined as
  152. macros. Function prototypes shall be provided.
  153. .sp
  154. .RS 4
  155. .nf
  156. void clearerr(FILE *);
  157. char *ctermid(char *);
  158. int dprintf(int, const char *restrict, ...)
  159. int fclose(FILE *);
  160. FILE *fdopen(int, const char *);
  161. int feof(FILE *);
  162. int ferror(FILE *);
  163. int fflush(FILE *);
  164. int fgetc(FILE *);
  165. int fgetpos(FILE *restrict, fpos_t *restrict);
  166. char *fgets(char *restrict, int, FILE *restrict);
  167. int fileno(FILE *);
  168. void flockfile(FILE *);
  169. FILE *fmemopen(void *restrict, size_t, const char *restrict);
  170. FILE *fopen(const char *restrict, const char *restrict);
  171. int fprintf(FILE *restrict, const char *restrict, ...);
  172. int fputc(int, FILE *);
  173. int fputs(const char *restrict, FILE *restrict);
  174. size_t fread(void *restrict, size_t, size_t, FILE *restrict);
  175. FILE *freopen(const char *restrict, const char *restrict,
  176. FILE *restrict);
  177. int fscanf(FILE *restrict, const char *restrict, ...);
  178. int fseek(FILE *, long, int);
  179. int fseeko(FILE *, off_t, int);
  180. int fsetpos(FILE *, const fpos_t *);
  181. long ftell(FILE *);
  182. off_t ftello(FILE *);
  183. int ftrylockfile(FILE *);
  184. void funlockfile(FILE *);
  185. size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict);
  186. int getc(FILE *);
  187. int getchar(void);
  188. int getc_unlocked(FILE *);
  189. int getchar_unlocked(void);
  190. ssize_t getdelim(char **restrict, size_t *restrict, int,
  191. FILE *restrict);
  192. ssize_t getline(char **restrict, size_t *restrict, FILE *restrict);
  193. char *gets(char *);
  194. FILE *open_memstream(char **, size_t *);
  195. int pclose(FILE *);
  196. void perror(const char *);
  197. FILE *popen(const char *, const char *);
  198. int printf(const char *restrict, ...);
  199. int putc(int, FILE *);
  200. int putchar(int);
  201. int putc_unlocked(int, FILE *);
  202. int putchar_unlocked(int);
  203. int puts(const char *);
  204. int remove(const char *);
  205. int rename(const char *, const char *);
  206. int renameat(int, const char *, int, const char *);
  207. void rewind(FILE *);
  208. int scanf(const char *restrict, ...);
  209. void setbuf(FILE *restrict, char *restrict);
  210. int setvbuf(FILE *restrict, char *restrict, int, size_t);
  211. int snprintf(char *restrict, size_t, const char *restrict, ...);
  212. int sprintf(char *restrict, const char *restrict, ...);
  213. int sscanf(const char *restrict, const char *restrict, ...);
  214. char *tempnam(const char *, const char *);
  215. FILE *tmpfile(void);
  216. char *tmpnam(char *);
  217. int ungetc(int, FILE *);
  218. int vdprintf(int, const char *restrict, va_list);
  219. int vfprintf(FILE *restrict, const char *restrict, va_list);
  220. int vfscanf(FILE *restrict, const char *restrict, va_list);
  221. int vprintf(const char *restrict, va_list);
  222. int vscanf(const char *restrict, va_list);
  223. int vsnprintf(char *restrict, size_t, const char *restrict,
  224. va_list);
  225. int vsprintf(char *restrict, const char *restrict, va_list);
  226. int vsscanf(const char *restrict, const char *restrict, va_list);
  227. .fi
  228. .P
  229. .RE
  230. .P
  231. Inclusion of the
  232. .IR <stdio.h>
  233. header may also make visible all symbols from
  234. .IR <stddef.h> .
  235. .LP
  236. .IR "The following sections are informative."
  237. .SH "APPLICATION USAGE"
  238. Since standard I/O streams may use an underlying file descriptor to
  239. access the file associated with a stream, application developers need
  240. to be aware that
  241. {FOPEN_MAX}
  242. streams may not be available if file descriptors are being used to access
  243. files that are not associated with streams.
  244. .SH RATIONALE
  245. There is a conflict between the ISO\ C standard and the POSIX definition of the
  246. {TMP_MAX}
  247. macro that is addressed by ISO/IEC\ 9899:\|1999 standard, Defect Report 336. The POSIX standard is
  248. in alignment with the public record of the response to the Defect Report.
  249. This change has not yet been published as part of the ISO\ C standard.
  250. .SH "FUTURE DIRECTIONS"
  251. None.
  252. .SH "SEE ALSO"
  253. .IR "\fB<stdarg.h>\fP",
  254. .IR "\fB<stddef.h>\fP",
  255. .IR "\fB<sys_types.h>\fP"
  256. .P
  257. .ad l
  258. The System Interfaces volume of POSIX.1\(hy2017,
  259. .IR "Section 2.2" ", " "The Compilation Environment",
  260. .IR "\fIclearerr\fR\^(\|)",
  261. .IR "\fIctermid\fR\^(\|)",
  262. .IR "\fIfclose\fR\^(\|)",
  263. .IR "\fIfdopen\fR\^(\|)",
  264. .IR "\fIfeof\fR\^(\|)",
  265. .IR "\fIferror\fR\^(\|)",
  266. .IR "\fIfflush\fR\^(\|)",
  267. .IR "\fIfgetc\fR\^(\|)",
  268. .IR "\fIfgetpos\fR\^(\|)",
  269. .IR "\fIfgets\fR\^(\|)",
  270. .IR "\fIfileno\fR\^(\|)",
  271. .IR "\fIflockfile\fR\^(\|)",
  272. .IR "\fIfmemopen\fR\^(\|)",
  273. .IR "\fIfopen\fR\^(\|)",
  274. .IR "\fIfprintf\fR\^(\|)",
  275. .IR "\fIfputc\fR\^(\|)",
  276. .IR "\fIfputs\fR\^(\|)",
  277. .IR "\fIfread\fR\^(\|)",
  278. .IR "\fIfreopen\fR\^(\|)",
  279. .IR "\fIfscanf\fR\^(\|)",
  280. .IR "\fIfseek\fR\^(\|)",
  281. .IR "\fIfsetpos\fR\^(\|)",
  282. .IR "\fIftell\fR\^(\|)",
  283. .IR "\fIfwrite\fR\^(\|)",
  284. .IR "\fIgetc\fR\^(\|)",
  285. .IR "\fIgetchar\fR\^(\|)",
  286. .IR "\fIgetc_unlocked\fR\^(\|)",
  287. .IR "\fIgetdelim\fR\^(\|)",
  288. .IR "\fIgetopt\fR\^(\|)",
  289. .IR "\fIgets\fR\^(\|)",
  290. .IR "\fIopen_memstream\fR\^(\|)",
  291. .IR "\fIpclose\fR\^(\|)",
  292. .IR "\fIperror\fR\^(\|)",
  293. .IR "\fIpopen\fR\^(\|)",
  294. .IR "\fIputc\fR\^(\|)",
  295. .IR "\fIputchar\fR\^(\|)",
  296. .IR "\fIputs\fR\^(\|)",
  297. .IR "\fIremove\fR\^(\|)",
  298. .IR "\fIrename\fR\^(\|)",
  299. .IR "\fIrewind\fR\^(\|)",
  300. .IR "\fIsetbuf\fR\^(\|)",
  301. .IR "\fIsetvbuf\fR\^(\|)",
  302. .IR "\fIstdin\fR\^",
  303. .IR "\fIsystem\fR\^(\|)",
  304. .IR "\fItempnam\fR\^(\|)",
  305. .IR "\fItmpfile\fR\^(\|)",
  306. .IR "\fItmpnam\fR\^(\|)",
  307. .IR "\fIungetc\fR\^(\|)",
  308. .IR "\fIvfprintf\fR\^(\|)",
  309. .IR "\fIvfscanf\fR\^(\|)"
  310. .ad b
  311. .\"
  312. .SH COPYRIGHT
  313. Portions of this text are reprinted and reproduced in electronic form
  314. from IEEE Std 1003.1-2017, Standard for Information Technology
  315. -- Portable Operating System Interface (POSIX), The Open Group Base
  316. Specifications Issue 7, 2018 Edition,
  317. Copyright (C) 2018 by the Institute of
  318. Electrical and Electronics Engineers, Inc and The Open Group.
  319. In the event of any discrepancy between this version and the original IEEE and
  320. The Open Group Standard, the original IEEE and The Open Group Standard
  321. is the referee document. The original Standard can be obtained online at
  322. http://www.opengroup.org/unix/online.html .
  323. .PP
  324. Any typographical or formatting errors that appear
  325. in this page are most likely
  326. to have been introduced during the conversion of the source files to
  327. man page format. To report such errors, see
  328. https://www.kernel.org/doc/man-pages/reporting_bugs.html .