Skip to content

Commit

Permalink
Merge pull request #1223 from no92/openat
Browse files Browse the repository at this point in the history
sysdeps/managarm: handle remaining flags in `sys_openat`
  • Loading branch information
Dennisbonke authored Jan 16, 2025
2 parents 46d5553 + b9083e4 commit a3bdc24
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sysdeps/managarm/generic/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,10 @@ int sys_openat(int dirfd, const char *path, int flags, mode_t mode, int *fd) {
proto_flags |= managarm::posix::OpenFlags::OF_CLOEXEC;
if (flags & O_NOCTTY)
proto_flags |= managarm::posix::OpenFlags::OF_NOCTTY;
if (flags & O_NOFOLLOW)
proto_flags |= managarm::posix::OpenFlags::OF_NOFOLLOW;
if (flags & O_DIRECTORY)
proto_flags |= managarm::posix::OpenFlags::OF_DIRECTORY;

if (flags & O_PATH)
proto_flags |= managarm::posix::OpenFlags::OF_PATH;
Expand Down Expand Up @@ -1546,6 +1550,8 @@ int sys_openat(int dirfd, const char *path, int flags, mode_t mode, int *fd) {
return EISDIR;
} else if (resp.error() == managarm::posix::Errors::ILLEGAL_ARGUMENTS) {
return EINVAL;
} else if (resp.error() == managarm::posix::Errors::SYMBOLIC_LINK_LOOP) {
return ELOOP;
} else {
__ensure(resp.error() == managarm::posix::Errors::SUCCESS);
*fd = resp.fd();
Expand Down

0 comments on commit a3bdc24

Please sign in to comment.