Displaying 2 results from an estimated 2 matches for "71ee75c".
Did you mean:
71ec754
2016 Feb 01
0
[klibc:master] fwrite: flush before a large write to allow better bypass
...system calls, since we will always
need to do two system calls in this case.
Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---
usr/klibc/stdio/fwrite.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/usr/klibc/stdio/fwrite.c b/usr/klibc/stdio/fwrite.c
index 71ee75c..feb48ef 100644
--- a/usr/klibc/stdio/fwrite.c
+++ b/usr/klibc/stdio/fwrite.c
@@ -14,14 +14,15 @@ static size_t fwrite_noflush(const void *buf, size_t count,
ssize_t rv;
while (count) {
- if (f->ibytes || f->obytes >= f->bufsiz)
+ if (f->ibytes || f->obytes >= f->buf...
2014 Apr 09
0
[klibc:master] fwrite: use memrchr() to find the final ' \n' in _IOLBF mode
...in the string.)
Use memrchr() instead of open-coding it.
Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
---
usr/klibc/stdio/fwrite.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/usr/klibc/stdio/fwrite.c b/usr/klibc/stdio/fwrite.c
index 5d2c3f0..71ee75c 100644
--- a/usr/klibc/stdio/fwrite.c
+++ b/usr/klibc/stdio/fwrite.c
@@ -59,6 +59,7 @@ size_t _fwrite(const void *buf, size_t count, FILE *file)
size_t bytes = 0;
size_t pf_len, pu_len;
const char *p = buf;
+ const char *q;
/* We divide the data into two chunks, flushed (pf)
and unfl...