blob: b2ef172f8ff96867ccf220545631a7ab0f36657b [file]
<html lang="en">
<head>
<title>setlinebuf - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Stdio.html#Stdio" title="Stdio">
<link rel="prev" href="setbuffer.html#setbuffer" title="setbuffer">
<link rel="next" href="setvbuf.html#setvbuf" title="setvbuf">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="setlinebuf"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="setvbuf.html#setvbuf">setvbuf</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="setbuffer.html#setbuffer">setbuffer</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Stdio.html#Stdio">Stdio</a>
<hr>
</div>
<h3 class="section">4.56 <code>setlinebuf</code>&mdash;specify line buffering for a file or stream</h3>
<p><a name="index-setlinebuf-265"></a><strong>Synopsis</strong>
<pre class="example"> #include &lt;stdio.h&gt;
void setlinebuf(FILE *<var>fp</var>);
</pre>
<p><strong>Description</strong><br>
<code>setlinebuf</code> specifies that output to the file or stream identified by
<var>fp</var> should be line buffered. This causes the file or stream to pass
on output to the host system at every newline, as well as when the
buffer is full, or when an input operation intervenes.
<p><br>
<strong>Warnings</strong><br>
You may only use <code>setlinebuf</code> before performing any file operation
other than opening the file.
<p><br>
<strong>Returns</strong><br>
<code>setlinebuf</code> returns as per setvbuf.
<p><br>
<strong>Portability</strong><br>
This function comes from BSD not ANSI or POSIX.
<p>Supporting OS subroutines required: <code>close</code>, <code>fstat</code>, <code>isatty</code>,
<code>lseek</code>, <code>read</code>, <code>sbrk</code>, <code>write</code>.
<p><br>
</body></html>