mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
Kernel+LibC: Implement the openat() syscall
POSIX's openat() is very similar to open(), except you also provide a file descriptor referring to a directory from which relative paths should be resolved. Passing it the magical fd number AT_FDCWD means "resolve from current directory" (which is indeed also what open() normally does.) This fixes libarchive's bsdtar, since it was trying to do something extremely wrong in the absence of openat() support. The issue has recently been fixed upstream in libarchive: https://github.com/libarchive/libarchive/issues/1239 However, we should have openat() support anyway, so I went ahead and implemented it. :^) Fixes #748.
This commit is contained in:
parent
4f27745136
commit
18348cebf1
6 changed files with 80 additions and 7 deletions
|
@ -124,6 +124,7 @@ public:
|
|||
pid_t sys$getppid();
|
||||
mode_t sys$umask(mode_t);
|
||||
int sys$open(const Syscall::SC_open_params*);
|
||||
int sys$openat(const Syscall::SC_openat_params*);
|
||||
int sys$close(int fd);
|
||||
ssize_t sys$read(int fd, u8*, ssize_t);
|
||||
ssize_t sys$write(int fd, const u8*, ssize_t);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue