Commit-ID: c5123e9482fff0b86b30bda74e94ae2d66ef01bf
Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=c5123e9482fff0b86b30bda74e94ae2d66ef01bf
Author: H. Peter Anvin <hp...@zy...>
AuthorDate: Thu, 28 Jan 2016 20:44:33 -0800
Committer: H. Peter Anvin <hp...@zy...>
CommitDate: Thu, 28 Jan 2016 20:44:33 -0800
nasmlib.h: If BUFSIZ is bigger than the default ZERO_BUF_SIZE, adjust
If BUFSIZ exists and is bigger than the default ZERO_BUF_SIZE, expand
ZERO_BUF_SIZE so we don't end up unnecessarily double buffering in the
stdio library.
Signed-off-by: H. Peter Anvin <hp...@zy...>
---
nasmlib.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/nasmlib.h b/nasmlib.h
index 9cd417f..e8526ab 100644
--- a/nasmlib.h
+++ b/nasmlib.h
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 1996-2009 The NASM Authors - All Rights Reserved
+ * Copyright 1996-2016 The NASM Authors - All Rights Reserved
* See the file AUTHORS included with the NASM distribution for
* the specific copyright holders.
*
@@ -409,7 +409,10 @@ char *nasm_realpath(const char *rel_path);
const char *prefix_name(int);
-#define ZERO_BUF_SIZE 4096
+#define ZERO_BUF_SIZE 4096 /* Default value */
+#if defined(BUFSIZ) && (BUFSIZ > ZERO_BUF_SIZE)
+# define ZERO_BUF_SIZE BUFSIZ
+#endif
extern const uint8_t zero_buffer[ZERO_BUF_SIZE];
void fwritezero(size_t bytes, FILE *fp);
|