diff options
Diffstat (limited to 'libc/include/bits/fortify/fcntl.h')
-rw-r--r-- | libc/include/bits/fortify/fcntl.h | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/libc/include/bits/fortify/fcntl.h b/libc/include/bits/fortify/fcntl.h index 75cd4f2ed..e7f2c8263 100644 --- a/libc/include/bits/fortify/fcntl.h +++ b/libc/include/bits/fortify/fcntl.h @@ -44,7 +44,6 @@ int __openat_real(int, const char*, int, ...) __RENAME(openat); #define __open_useless_modes_warning "has superfluous mode bits; missing O_CREAT?" /* O_TMPFILE shares bits with O_DIRECTORY. */ #define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE) -#if defined(__clang__) #if __ANDROID_API__ >= __ANDROID_API_J_MR1__ __BIONIC_ERROR_FUNCTION_VISIBILITY @@ -93,52 +92,6 @@ int openat(int dirfd, const char* const __pass_object_size pathname, int flags, } #endif /* __ANDROID_API__ >= __ANDROID_API_J_MR1__ */ -#else /* defined(__clang__) */ -__errordecl(__creat_missing_mode, __open_too_few_args_error); -__errordecl(__creat_too_many_args, __open_too_many_args_error); - -#if __ANDROID_API__ >= __ANDROID_API_J_MR1__ -__BIONIC_FORTIFY_VARIADIC -int open(const char* pathname, int flags, ...) { - if (__builtin_constant_p(flags)) { - if (__open_modes_useful(flags) && __builtin_va_arg_pack_len() == 0) { - __creat_missing_mode(); /* Compile time error. */ - } - } - - if (__builtin_va_arg_pack_len() > 1) { - __creat_too_many_args(); /* Compile time error. */ - } - - if ((__builtin_va_arg_pack_len() == 0) && !__builtin_constant_p(flags)) { - return __open_2(pathname, flags); - } - - return __open_real(pathname, flags, __builtin_va_arg_pack()); -} - -__BIONIC_FORTIFY_VARIADIC -int openat(int dirfd, const char* pathname, int flags, ...) { - if (__builtin_constant_p(flags)) { - if (__open_modes_useful(flags) && __builtin_va_arg_pack_len() == 0) { - __creat_missing_mode(); /* Compile time error. */ - } - } - - if (__builtin_va_arg_pack_len() > 1) { - __creat_too_many_args(); /* Compile time error. */ - } - - if ((__builtin_va_arg_pack_len() == 0) && !__builtin_constant_p(flags)) { - return __openat_2(dirfd, pathname, flags); - } - - return __openat_real(dirfd, pathname, flags, __builtin_va_arg_pack()); -} -#endif /* __ANDROID_API__ >= __ANDROID_API_J_MR1__ */ - -#endif /* defined(__clang__) */ - #undef __open_too_many_args_error #undef __open_too_few_args_error #undef __open_useless_modes_warning |