source: trunk/libs/newlib/src/newlib/libc/stdio/setlinebuf.c @ 567

Last change on this file since 567 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.8 KB
Line 
1/*
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms are permitted
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley.  The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16 */
17/*
18Modified copy of setbuf.c to support setlinebuf function
19defined as part of BSD.
20Modifications by Gareth Pearce, 2001.
21*/
22
23/*
24FUNCTION
25<<setlinebuf>>---specify line buffering for a file or stream
26
27INDEX
28        setlinebuf
29
30SYNOPSIS
31        #include <stdio.h>
32        void setlinebuf(FILE *<[fp]>);
33
34DESCRIPTION
35<<setlinebuf>> specifies that output to the file or stream identified by
36<[fp]> should be line buffered.  This causes the file or stream to pass
37on output to the host system at every newline, as well as when the
38buffer is full, or when an input operation intervenes.
39
40WARNINGS
41You may only use <<setlinebuf>> before performing any file operation
42other than opening the file.
43
44RETURNS
45<<setlinebuf>> returns as per setvbuf.
46
47PORTABILITY
48This function comes from BSD not ANSI or POSIX.
49
50Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
51<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
52*/
53
54#include <_ansi.h>
55#include <stdio.h>
56#include "local.h"
57
58int
59setlinebuf (FILE * fp)
60{
61  return (setvbuf (fp, (char *) NULL, _IOLBF, (size_t) 0));
62}
Note: See TracBrowser for help on using the repository browser.