The mode argument specifies the file mode bits be applied when
a new file is created. This argument must be supplied when
O_CREAT or O_TMPFILE is specified in flags; if neither O_CREAT
nor O_TMPFILE is specified, then mode is ignored. The
effective mode is modified by the process's umask in the usual
way: in the absence of a default ACL, the mode of the created
file is (mode & ~umask). Note that this mode applies only to
future accesses of the newly created file; the open() call
that creates a read-only file may well return a read/write
file descriptor.
https://github.com/misson20000/twili/blob/cfb38cb6d999ed3357231e996a11bc8b70754b0a/twib/platform/unix/platform/platform.cpp#L65 is invalid according to http://man7.org/linux/man-pages/man2/open.2.html (and my gcc):