xref: /csrg-svn/lib/libc/stdio/setbuffer.c (revision 46104)
1*46104Sbostic /*-
2*46104Sbostic  * Copyright (c) 1990 The Regents of the University of California.
3*46104Sbostic  * All rights reserved.
4*46104Sbostic  *
5*46104Sbostic  * This code is derived from software contributed to Berkeley by
6*46104Sbostic  * Chris Torek.
7*46104Sbostic  *
8*46104Sbostic  * %sccs.include.redist.c%
921410Sdist  */
1021410Sdist 
1126661Sdonn #if defined(LIBC_SCCS) && !defined(lint)
12*46104Sbostic static char sccsid[] = "@(#)setbuffer.c	5.3 (Berkeley) 01/20/91";
13*46104Sbostic #endif /* LIBC_SCCS and not lint */
1421410Sdist 
15*46104Sbostic #include <stdio.h>
16*46104Sbostic #include <stdlib.h>
178327Smckusick 
18*46104Sbostic void
19*46104Sbostic setbuffer(fp, buf, size)
20*46104Sbostic 	register FILE *fp;
218327Smckusick 	char *buf;
228327Smckusick 	int size;
238327Smckusick {
24*46104Sbostic 	(void) setvbuf(fp, buf, buf ? _IONBF : _IOFBF, size);
258327Smckusick }
2611307Smckusick 
2711307Smckusick /*
28*46104Sbostic  * set line buffering
2911307Smckusick  */
30*46104Sbostic setlinebuf(fp)
31*46104Sbostic 	FILE *fp;
3211307Smckusick {
33*46104Sbostic 	(void) setvbuf(fp, (char *)NULL, _IOLBF, (size_t)0);
34*46104Sbostic 	return (0);	/* ??? */
3511307Smckusick }
36