Add <unistd.h> with read, write and close functions
This commit is contained in:
parent
643baf8dec
commit
12bcb703a5
|
@ -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
|
|
@ -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);
|
||||||
|
}
|
Loading…
Reference in New Issue