It doesn't.
The implementation will evaluate the third argument whenever it sees the O_CREAT
flag. If you didn't pass the third argument, behaviour is undefined, much in the same way as when you lie to printf
about its arguments (e.g. pass %s
as the format string, but forget to actually pass a string to be inserted).