1 #if defined(__cplusplus)
2 extern "C" {
3 #endif
4 
5 extern int open_real(const char* name, int flags, ...) __asm__("open");
6 
7 #define O_CREAT 00000100
8 
9 typedef unsigned int mode_t;
10 
11 static inline __attribute__((always_inline))
open(const char * name,int flags)12 int open(const char* name, int flags)
13     __attribute__((annotate("versioner_fortify_inline")))
14     __attribute__((overloadable))
15     __attribute__((enable_if(!(flags & O_CREAT), ""))) {
16   return open_real(name, flags);
17 }
18 
19 static inline __attribute__((always_inline))
open(const char * name,int flags,mode_t mode)20 int open(const char* name, int flags, mode_t mode)
21     __attribute__((annotate("versioner_fortify_inline")))
22     __attribute__((overloadable))
23     __attribute__((enable_if(flags & O_CREAT, ""))) {
24   return open_real(name, flags, mode);
25 }
26 
27 #if defined(__cplusplus)
28 }
29 #endif
30