Today, looking at the man page for open(), I\'ve noticed this function is \'overloaded\':
open()
int open(const char *pathname, int flags); int o
"mode must be specified when O_CREAT is in the flags, and is ignored otherwise."
extern int open (__const char *__file, int __oflag, ...)
It uses varargs and only loads the mode variable argument if __oflag contains O_CREAT.
varargs
__oflag
O_CREAT