According to the Linux manual page, the Linux C API open has two prototypes as follows:
int open(const char *pathname, int oflags);
int open(const char *pathname, int oflags, mode_t mode);
What makes me confused is:
Why does the Linux C API 'open' support function overloading??
No, C doesn't support function overloading.
The POSIX open function is actually a variadic function, its signature is:
int open(const char *path, int oflag, ... );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With