summaryrefslogtreecommitdiff
path: root/src/lib/libc/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/include')
-rw-r--r--src/lib/libc/include/stdio.h7
-rw-r--r--src/lib/libc/include/string.h9
-rw-r--r--src/lib/libc/include/unistd.h18
3 files changed, 34 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/include/string.h b/src/lib/libc/include/string.h
index 1572400..360af12 100644
--- a/src/lib/libc/include/string.h
+++ b/src/lib/libc/include/string.h
@@ -93,4 +93,13 @@ void *memset(void *s, int c, size_t n);
*/
char *itoa(int64_t value, char *buf, int base);
+/*
+ * Compare two byte streams
+ *
+ * @s1: Stream one
+ * @s2: Stream two
+ * @n: Max bytes to compare
+ */
+int memcmp(const void *s1, const void *s2, size_t n);
+
#endif /* _STRING_H */
diff --git a/src/lib/libc/include/unistd.h b/src/lib/libc/include/unistd.h
index fa7f951..b668d5b 100644
--- a/src/lib/libc/include/unistd.h
+++ b/src/lib/libc/include/unistd.h
@@ -48,6 +48,15 @@
int open(const char *path, int flags);
/*
+ * Close a file using its file descriptor
+ *
+ * @fd: File descriptor to close
+ *
+ * Returns zero on success
+ */
+int close(int fd);
+
+/*
* POSIX write system call
*
* @fd: File descriptor to write at
@@ -56,4 +65,13 @@ int open(const char *path, int flags);
*/
ssize_t write(int fd, const void *buf, size_t count);
+/*
+ * POSIX read system call
+ *
+ * @fd: File descriptor to read
+ * @buf: Buffer to read into
+ * @count: Number of bytes to read
+ */
+ssize_t read(int fd, void *buf, size_t count);
+
#endif /* _UNISTD_H */