summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/include/stdio.h7
-rw-r--r--src/lib/libc/src/stdio/puts.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/libc/include/stdio.h b/src/lib/libc/include/stdio.h
index c8b7c10..31d59a5 100644
--- a/src/lib/libc/include/stdio.h
+++ b/src/lib/libc/include/stdio.h
@@ -53,6 +53,13 @@ int vsnprintf(char *s, size_t size, const char *fmt, va_list ap);
int snprintf(char *s, size_t size, const char *fmt, ...);
/*
+ * Write a character to stdout
+ *
+ * @c: Character to write
+ */
+int putchar(int c);
+
+/*
* Print a formatted string
*/
int printf(const char *__restrict fmt, ...);
diff --git a/src/lib/libc/src/stdio/puts.c b/src/lib/libc/src/stdio/puts.c
index 6446e10..021bf89 100644
--- a/src/lib/libc/src/stdio/puts.c
+++ b/src/lib/libc/src/stdio/puts.c
@@ -46,3 +46,10 @@ puts(const char *s)
write(STDOUT_FILENO, &ch_lf, 1);
return slen + 1;
}
+
+int
+putchar(int c)
+{
+ write(STDOUT_FILENO, &c, 1);
+ return c;
+}