setbuf.3 (79531) | setbuf.3 (79754) |
---|---|
1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" the American National Standards Committee X3, on Information 6.\" Processing Systems. 7.\" 8.\" Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34.\" SUCH DAMAGE. 35.\" 36.\" @(#)setbuf.3 8.1 (Berkeley) 6/4/93 | 1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" the American National Standards Committee X3, on Information 6.\" Processing Systems. 7.\" 8.\" Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34.\" SUCH DAMAGE. 35.\" 36.\" @(#)setbuf.3 8.1 (Berkeley) 6/4/93 |
37.\" $FreeBSD: head/lib/libc/stdio/setbuf.3 79531 2001-07-10 13:41:46Z ru $ | 37.\" $FreeBSD: head/lib/libc/stdio/setbuf.3 79754 2001-07-15 07:53:42Z dd $ |
38.\" 39.Dd June 4, 1993 40.Dt SETBUF 3 41.Os 42.Sh NAME 43.Nm setbuf , 44.Nm setbuffer , 45.Nm setlinebuf , --- 18 unchanged lines hidden (view full) --- 64destination file or terminal as soon as written; 65when it is block buffered many characters are saved up and written as a block; 66when it is line buffered characters are saved up until a newline is 67output or input is read from any stream attached to a terminal device 68(typically stdin). 69The function 70.Xr fflush 3 71may be used to force the block out early. | 38.\" 39.Dd June 4, 1993 40.Dt SETBUF 3 41.Os 42.Sh NAME 43.Nm setbuf , 44.Nm setbuffer , 45.Nm setlinebuf , --- 18 unchanged lines hidden (view full) --- 64destination file or terminal as soon as written; 65when it is block buffered many characters are saved up and written as a block; 66when it is line buffered characters are saved up until a newline is 67output or input is read from any stream attached to a terminal device 68(typically stdin). 69The function 70.Xr fflush 3 71may be used to force the block out early. |
72(See | 72(See |
73.Xr fclose 3 . ) 74.Pp 75Normally all files are block buffered. 76When the first 77.Tn I/O 78operation occurs on a file, 79.Xr malloc 3 80is called, --- 22 unchanged lines hidden (view full) --- 103fully buffered 104.El 105.Pp 106The 107.Fa size 108parameter may be given as zero 109to obtain deferred optimal-size buffer allocation as usual. 110If it is not zero, | 73.Xr fclose 3 . ) 74.Pp 75Normally all files are block buffered. 76When the first 77.Tn I/O 78operation occurs on a file, 79.Xr malloc 3 80is called, --- 22 unchanged lines hidden (view full) --- 103fully buffered 104.El 105.Pp 106The 107.Fa size 108parameter may be given as zero 109to obtain deferred optimal-size buffer allocation as usual. 110If it is not zero, |
111then except for unbuffered files, the | 111then except for unbuffered files, the |
112.Fa buf 113argument should point to a buffer at least 114.Fa size 115bytes long; 116this buffer will be used instead of the current buffer. 117(If the 118.Fa size 119argument --- 10 unchanged lines hidden (view full) --- 130.Pp 131The 132.Fn setvbuf 133function may be used at any time, 134but may have peculiar side effects 135(such as discarding input or flushing output) 136if the stream is ``active''. 137Portable applications should call it only once on any given stream, | 112.Fa buf 113argument should point to a buffer at least 114.Fa size 115bytes long; 116this buffer will be used instead of the current buffer. 117(If the 118.Fa size 119argument --- 10 unchanged lines hidden (view full) --- 130.Pp 131The 132.Fn setvbuf 133function may be used at any time, 134but may have peculiar side effects 135(such as discarding input or flushing output) 136if the stream is ``active''. 137Portable applications should call it only once on any given stream, |
138and before any | 138and before any |
139.Tn I/O 140is performed. 141.Pp 142The other three calls are, in effect, simply aliases for calls to 143.Fn setvbuf . 144Except for the lack of a return value, the 145.Fn setbuf 146function is exactly equivalent to the call --- 59 unchanged lines hidden --- | 139.Tn I/O 140is performed. 141.Pp 142The other three calls are, in effect, simply aliases for calls to 143.Fn setvbuf . 144Except for the lack of a return value, the 145.Fn setbuf 146function is exactly equivalent to the call --- 59 unchanged lines hidden --- |