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
  • 39,765
  • 26
  • 162
  • 323

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
  • 119,891
  • 44
  • 235
  • 294