mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
Kernel: Implement fchdir syscall
The fchdir() function is equivalent to chdir() except that the directory that is to be the new current working directory is specified by a file descriptor.
This commit is contained in:
parent
26e81ad574
commit
7d85fc00e4
6 changed files with 24 additions and 0 deletions
|
@ -265,6 +265,12 @@ int chdir(const char* path)
|
|||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int fchdir(int fd)
|
||||
{
|
||||
int rc = syscall(SC_fchdir, fd);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
char* getcwd(char* buffer, size_t size)
|
||||
{
|
||||
if (!buffer) {
|
||||
|
|
|
@ -68,6 +68,7 @@ int close(int fd);
|
|||
pid_t waitpid(pid_t, int* wstatus, int options);
|
||||
pid_t wait(int* wstatus);
|
||||
int chdir(const char* path);
|
||||
int fchdir(int fd);
|
||||
char* getcwd(char* buffer, size_t size);
|
||||
char* getwd(char* buffer);
|
||||
int fstat(int fd, struct stat* statbuf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue