146104Sbostic /*-
2*61180Sbostic * Copyright (c) 1990, 1993
3*61180Sbostic * The Regents of the University of California. All rights reserved.
446104Sbostic *
546104Sbostic * This code is derived from software contributed to Berkeley by
646104Sbostic * Chris Torek.
746104Sbostic *
846104Sbostic * %sccs.include.redist.c%
921410Sdist */
1021410Sdist
1126661Sdonn #if defined(LIBC_SCCS) && !defined(lint)
12*61180Sbostic static char sccsid[] = "@(#)setbuffer.c 8.1 (Berkeley) 06/04/93";
1346104Sbostic #endif /* LIBC_SCCS and not lint */
1421410Sdist
1546104Sbostic #include <stdio.h>
168327Smckusick
1746104Sbostic void
setbuffer(fp,buf,size)1846104Sbostic setbuffer(fp, buf, size)
1946104Sbostic register FILE *fp;
208327Smckusick char *buf;
218327Smckusick int size;
228327Smckusick {
2347550Storek
2456988Storek (void)setvbuf(fp, buf, buf ? _IOFBF : _IONBF, size);
258327Smckusick }
2611307Smckusick
2711307Smckusick /*
2846104Sbostic * set line buffering
2911307Smckusick */
3056988Storek int
setlinebuf(fp)3146104Sbostic setlinebuf(fp)
3246104Sbostic FILE *fp;
3311307Smckusick {
3447550Storek
3556988Storek return (setvbuf(fp, (char *)NULL, _IOLBF, (size_t)0));
3611307Smckusick }
37