• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/toolchains/hndtools-armeabi-2013.11/share/doc/arm-arm-none-eabi/html/libc/
1<html lang="en">
2<head>
3<title>setbuf - Untitled</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="Untitled">
6<meta name="generator" content="makeinfo 4.13">
7<link title="Top" rel="start" href="index.html#Top">
8<link rel="up" href="Stdio.html#Stdio" title="Stdio">
9<link rel="prev" href="rewind.html#rewind" title="rewind">
10<link rel="next" href="setbuffer.html#setbuffer" title="setbuffer">
11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
12<meta http-equiv="Content-Style-Type" content="text/css">
13<style type="text/css"><!--
14  pre.display { font-family:inherit }
15  pre.format  { font-family:inherit }
16  pre.smalldisplay { font-family:inherit; font-size:smaller }
17  pre.smallformat  { font-family:inherit; font-size:smaller }
18  pre.smallexample { font-size:smaller }
19  pre.smalllisp    { font-size:smaller }
20  span.sc    { font-variant:small-caps }
21  span.roman { font-family:serif; font-weight:normal; } 
22  span.sansserif { font-family:sans-serif; font-weight:normal; } 
23--></style>
24<link rel="stylesheet" type="text/css" href="../cs.css">
25</head>
26<body>
27<div class="node">
28<a name="setbuf"></a>
29<p>
30Next:&nbsp;<a rel="next" accesskey="n" href="setbuffer.html#setbuffer">setbuffer</a>,
31Previous:&nbsp;<a rel="previous" accesskey="p" href="rewind.html#rewind">rewind</a>,
32Up:&nbsp;<a rel="up" accesskey="u" href="Stdio.html#Stdio">Stdio</a>
33<hr>
34</div>
35
36<h3 class="section">4.54 <code>setbuf</code>&mdash;specify full buffering for a file or stream</h3>
37
38<p><a name="index-setbuf-263"></a><strong>Synopsis</strong>
39<pre class="example">     #include &lt;stdio.h&gt;
40     void setbuf(FILE *<var>fp</var>, char *<var>buf</var>);
41     
42</pre>
43   <p><strong>Description</strong><br>
44<code>setbuf</code> specifies that output to the file or stream identified by <var>fp</var>
45should be fully buffered.  All output for this file will go to a
46buffer (of size <code>BUFSIZ</code>, specified in `<code>stdio.h</code>').  Output will
47be passed on to the host system only when the buffer is full, or when
48an input operation intervenes.
49
50   <p>You may, if you wish, supply your own buffer by passing a pointer to
51it as the argument <var>buf</var>.  It must have size <code>BUFSIZ</code>.  You can
52also use <code>NULL</code> as the value of <var>buf</var>, to signal that the
53<code>setbuf</code> function is to allocate the buffer.
54
55   <p><br>
56<strong>Warnings</strong><br>
57You may only use <code>setbuf</code> before performing any file operation other
58than opening the file.
59
60   <p>If you supply a non-null <var>buf</var>, you must ensure that the associated
61storage continues to be available until you close the stream
62identified by <var>fp</var>.
63
64   <p><br>
65<strong>Returns</strong><br>
66<code>setbuf</code> does not return a result.
67
68   <p><br>
69<strong>Portability</strong><br>
70Both ANSI C and the System V Interface Definition (Issue 2) require
71<code>setbuf</code>.  However, they differ on the meaning of a <code>NULL</code> buffer
72pointer: the SVID issue 2 specification says that a <code>NULL</code> buffer
73pointer requests unbuffered output.  For maximum portability, avoid
74<code>NULL</code> buffer pointers.
75
76   <p>Supporting OS subroutines required: <code>close</code>, <code>fstat</code>, <code>isatty</code>,
77<code>lseek</code>, <code>read</code>, <code>sbrk</code>, <code>write</code>.
78
79   <p><br>
80
81   </body></html>
82
83