Kernel/LibC: Implement readlink and readlinkat
This commit is contained in:
@@ -59,6 +59,8 @@ __BEGIN_DECLS
|
||||
#define SYS_CREATE 56 // creat, mkfifo
|
||||
#define SYS_CREATE_DIR 57 // mkdir
|
||||
#define SYS_UNLINK 58
|
||||
#define SYS_READLINK 59
|
||||
#define SYS_READLINKAT 60
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
@@ -78,6 +78,16 @@ ssize_t write(int fildes, const void* buf, size_t nbyte)
|
||||
return syscall(SYS_WRITE, fildes, buf, nbyte);
|
||||
}
|
||||
|
||||
ssize_t readlink(const char* __restrict path, char* __restrict buf, size_t bufsize)
|
||||
{
|
||||
return syscall(SYS_READLINK, path, buf, bufsize);
|
||||
}
|
||||
|
||||
ssize_t readlinkat(int fd, const char* __restrict path, char* __restrict buf, size_t bufsize)
|
||||
{
|
||||
return syscall(SYS_READLINKAT, fd, path, buf, bufsize);
|
||||
}
|
||||
|
||||
int dup(int fildes)
|
||||
{
|
||||
return syscall(SYS_DUP, fildes);
|
||||
|
||||
Reference in New Issue
Block a user