mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-05 13:21:37 +00:00
Currently various flags in file and memory syscalls work mostly by an accident, because values of some of them align with corresponding Linux syscall flags. Some APIs weren't that lucky though - e.g. DkStreamOpen(..., /*options=*/PAL_OPTION_CLOEXEC) deletes file contents (sic!) intead of opening it with O_CLOEXEC. This is because PAL_OPTION_CLOEXEC == O_TRUNC. This commit fixes all this mess and also adds asserts to check validity of flags passed to Dk* handlers.