Add <unistd.h> with read, write and close functions

This commit is contained in:
g1n 2022-07-24 13:19:32 +03:00
parent 643baf8dec
commit 12bcb703a5
Signed by: g1n
GPG Key ID: 8D352193D65D4E2C
2 changed files with 25 additions and 0 deletions

11
src/include/unistd.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef _UNISTD_H
#define _UNISTD_H
#include <stddef.h>
#include <sys/types.h>
ssize_t read(int fildes, void *buf, size_t nbyte);
ssize_t write(int fildes, const void *buf, size_t nbyte);
int close(int fildes);
#endif

14
src/unistd.c Normal file
View File

@ -0,0 +1,14 @@
#include <unistd.h>
#include <liblinux.h>
ssize_t read(int fildes, void *buf, size_t nbyte) {
return sys_read(fildes, buf, nbyte);
}
ssize_t write(int fildes, const void *buf, size_t nbyte) {
return sys_write(fildes, buf, nbyte);
}
int close(int fildes) {
return sys_close(fildes);
}