core: use `O_RDONLY` instead of ambiguous `0` flag