Kernel/LibC: Implement chroot
This commit is contained in:
@@ -113,6 +113,7 @@ __BEGIN_DECLS
|
||||
O(SYS_FUTEX, futex) \
|
||||
O(SYS_GETGROUPS, getgroups) \
|
||||
O(SYS_SETGROUPS, setgroups) \
|
||||
O(SYS_CHROOT, chroot) \
|
||||
|
||||
enum Syscall
|
||||
{
|
||||
|
||||
@@ -596,6 +596,7 @@ int unlinkat(int fd, const char* path, int flag);
|
||||
int usleep(useconds_t usec);
|
||||
ssize_t write(int fildes, const void* buf, size_t nbyte);
|
||||
|
||||
int chroot(const char* path);
|
||||
int getpagesize(void);
|
||||
char* getpass(const char* prompt);
|
||||
|
||||
|
||||
@@ -626,6 +626,11 @@ int getopt(int argc, char* const argv[], const char* optstring)
|
||||
return '?';
|
||||
}
|
||||
|
||||
int chroot(const char* path)
|
||||
{
|
||||
return syscall(SYS_CHROOT, path);
|
||||
}
|
||||
|
||||
int getpagesize(void)
|
||||
{
|
||||
return PAGE_SIZE;
|
||||
|
||||
Reference in New Issue
Block a user