Skip to content

Commit

Permalink
fix: test case ut-lind-fs-mmap-invalid-flags-both
Browse files Browse the repository at this point in the history
  • Loading branch information
lind committed Sep 23, 2024
1 parent 255b216 commit efe0a2b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/safeposix/syscalls/fs_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,9 @@ impl Cage {
virtual_fd: i32,
off: i64,
) -> i32 {
if (flags & libc::MAP_PRIVATE != 0) && (flags & libc::MAP_SHARED != 0) {
return syscall_error(Errno::EINVAL, "mmap", "Invalid flags: both MAP_PRIVATE and MAP_SHARED set");
}
if virtual_fd != -1 {
match fdtables::translate_virtual_fd(self.cageid, virtual_fd as u64) {
Ok(kernel_fd) => {
Expand Down

0 comments on commit efe0a2b

Please sign in to comment.