setvbuf: Add support for configuration of line buffering.

This commit is contained in:
Gregory Nutt
2017-02-08 11:28:24 -06:00
parent 51a14c9b2f
commit 9f859774a1
21 changed files with 120 additions and 149 deletions
+6
View File
@@ -251,6 +251,12 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb)
stream->fs_bufpos = stream->fs_bufstart;
stream->fs_bufpos = stream->fs_bufstart;
stream->fs_bufread = stream->fs_bufstart;
/* Setup buffer flags */
#ifdef CONFIG_STDIO_LINEBUFFER
stream->fs_flags |= __FS_FLAG_LBF; /* Line buffering */
#endif
#endif
/* Save the file description and open flags. Setting the
* file descriptor locks this stream.