summaryrefslogtreecommitdiffstats
path: root/usr/klibc/fputc.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/klibc/fputc.c')
-rw-r--r--usr/klibc/fputc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/usr/klibc/fputc.c b/usr/klibc/fputc.c
new file mode 100644
index 0000000..7385d6f
--- /dev/null
+++ b/usr/klibc/fputc.c
@@ -0,0 +1,15 @@
+/*
+ * fputc.c
+ *
+ * gcc "printf decompilation" expects this to exist...
+ */
+
+#include <stdio.h>
+
+int fputc(int c, FILE *f)
+{
+ unsigned char ch = c;
+
+ return _fwrite(&ch, 1, f) == 1 ? ch : EOF;
+}
+__ALIAS(int, fputc_unlocked, (int, FILE *), fputc)