Added `memfd_secret()`"s disabled path. Added checks to translate valid flags {from,to} `memfd_{secret,create}()` (if the flag bits aren"t the same at comptime.)
if(FD_CLOEXEC!=MEMFD_CLOEXEC){// NOTE: This is a constant expression, and this code will be removed if they are equal.
//TODO: Translate mask `flags`, from `FD_CLOEXEC` (if it is set) -> `MEMFD_CLOEXEC`.
// Translate mask `flags`, from `FD_CLOEXEC` (if it is set) -> `MEMFD_CLOEXEC`.
if(FD_CLOEXEC!=MFD_CLOEXEC){// NOTE: This is a constant expression, and this code will be removed if they are equal.
// Check if all bit(s) of `FD_CLOEXEC` is in `flags`.
if((flags&FD_CLOEXEC)==FD_CLOEXEC){
// Mask out the `FD_CLOEXEC` bit(s)
flags&=~FD_CLOEXEC;
// Mask in the `MFD_CLOEXEC` bit(s)
flags|=MFD_CLOEXEC;
}// NOTE: We do not need to check cases where `flags & FD_CLOEXEC` is non-zero but the above branch is not hit, that would be an invalid call anyway. Plus I highly doubt any system will set `FD_CLOEXEC` to be more than 1 set bit anyway.