From 5ba2c21159f0bb4c0f7f1fbdbd4671f381b75816 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 1 Aug 2017 15:16:36 -0700 Subject: Finish . Implement __freading and __fwriting, and clarify the documentation that was the cause of these not being implemented for years. Bug: http://b/17157253 Test: ran tests Change-Id: I89542c8131b13889e2585417a024050ecf2abcb7 --- libc/stdio/stdio_ext.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'libc/stdio/stdio_ext.cpp') diff --git a/libc/stdio/stdio_ext.cpp b/libc/stdio/stdio_ext.cpp index ebc705c87..8cf4f4b3d 100644 --- a/libc/stdio/stdio_ext.cpp +++ b/libc/stdio/stdio_ext.cpp @@ -39,17 +39,13 @@ size_t __fbufsize(FILE* fp) { return fp->_bf._size; } -/* For a _SRW stream, we don't know whether we last read or wrote. int __freading(FILE* fp) { - return (fp->_flags & _SRD) != 0 || ...; + return (fp->_flags & __SRD) != 0; } -*/ -/* For a _SRW stream, we don't know whether we last read or wrote. -int __fwriting(FILE*) { - return (fp->_flags & _SWR) != 0 || ...; +int __fwriting(FILE* fp) { + return (fp->_flags & __SWR) != 0; } -*/ int __freadable(FILE* fp) { return (fp->_flags & (__SRD|__SRW)) != 0; -- cgit v1.2.3