From 4922f9cd5f507d9206b37333437c3397df07164a Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Wed, 27 Feb 2019 21:21:02 -0500 Subject: make "write" syscall directly if _POSIX_SOURCE is not defined --- src/stdio/fputc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/stdio') diff --git a/src/stdio/fputc.c b/src/stdio/fputc.c index 7b80f0ef..2d748751 100644 --- a/src/stdio/fputc.c +++ b/src/stdio/fputc.c @@ -5,7 +5,8 @@ #include "sys/types.h" #include "unistd.h" #else -#define write(fd, buf, size) -1 +#include "nonstd/syscall.h" +#define write(_fd, _buf, _size) __syscall(__lookup("write"), _fd, _buf, _size) #endif /** write a character to a file stream **/ @@ -24,10 +25,7 @@ int fputc(int c, FILE *stream) } funlockfile(stream); - /* - RETURN_SUCCESS(ARGUMENT(c)); - RETURN_FAILURE(CONSTANT(EOF)); - */ + return ch; } @@ -38,6 +36,9 @@ file position indicator, which is advanced. If ARGUMENT(stream) does not support seeking or was opened in append mode, the character is written to the end of the stream. ***/ + /* +RETURN_SUCCESS(ARGUMENT(c)) +RETURN_FAILURE(CONSTANT(EOF)) STDC(1) */ -- cgit v1.2.1