2

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??

xmllmx
  • 37,882
  • 21
  • 139
  • 300

1 Answers1

7

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, ... );
Yu Hao
  • 115,525
  • 42
  • 225
  • 281