Accessing non-existing varargs argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



open is declared as:

  int open(const char *pathname, int flags, ...);

The intent is to have two overloaded variants:

  int open(const char *pathname, int flags);
  int open(const char *pathname, int flags, mode_t mode);

The presence of the mode argument depends on the flags specified. The set of such flags is known by the kernel. I wish to avoid to maintain this implementation detail in libc as well, so I want to always read the mode argument, possibly passing a garbage value to the kernel.

Is there GCC-portable way to achieve this?

--
Florian Weimer / Red Hat Product Security




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux