add directory kernel

This commit is contained in:
gohigh
2024-02-19 00:24:53 -05:00
parent eec934fe6c
commit a4964ba92d
749 changed files with 100620 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#define __LIBRARY__
#include <unistd.h>
#include <stdarg.h>
int open(const char * filename, int flag, ...)
{
register int res;
va_list arg;
va_start(arg,flag);
__asm__("int $0x80"
:"=a" (res)
:"0" (__NR_open),"b" (filename),"c" (flag),
"d" (va_arg(arg,int)));
if (res>=0)
return res;
errno = -res;
return -1;
}