Lind-Project / RawPOSIX

Rust POSIX-compliant interface
Apache License 2.0
0 stars 0 forks source link

fix: test case `ut_lind_fs_mmap_no_write` #68

Closed ChinmayShringi closed 1 month ago

ChinmayShringi commented 1 month ago

Description

Fixes # (issue)

This PR updates the ut_lind_fs_mmap_no_write test to properly handle the case where a file opened with O_RDONLY (read-only) is mapped with write permissions (PROT_WRITE). The previous implementation directly compared the result of mmap_syscall with -(Errno::EACCES as i32), which is incorrect. Instead, mmap_syscall typically returns -1 on failure, and the actual error code (EACCES) is stored in errno.

Changes:

Type of change

How Has This Been Tested?

Checklist: