The open function is declared as a variational function. It will look something like this:
#include <stdarg.h> int open(char const * filename, int flags, ...) { va_list ap; va_start(ap, flags); if (flags & O_CREAT) { int mode = va_arg(ap, int); // ... } // ... va_end(ap); }
Further arguments are not expended unless you indicate that they really exist.
The same construction is used for printf .
This is not always made explicit in the manual, since the only two possible signatures are (char const *, int) and (char const *, int, int) , so it makes little sense to show that you are actually accepting variable arguments. (You can verify this by trying to compile something like open("", 1, 2, 3, 4, 5, 6) .)
source share