为什么我在Ubuntu上得到函数'open64'/'openat'/'openat64'的隐式声明?

Gua*_*Zhu 2 c linux gcc

gcc 4.8.2

#define __USE_FILE_OFFSET64
#define __USE_LARGEFILE64
#include <fcntl.h>

int
main(void) {
    int fd = open64("/", O_RDONLY);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

然后gcc的输出是'warning:隐式声明函数'open64'[-Wimplicit-function-declaration]'.但是在fcntl.h中:

#ifndef __USE_FILE_OFFSET64
extern int open (const char *__file, int __oflag, ...) __nonnull ((1));
#else
# ifdef __REDIRECT
extern int __REDIRECT (open, (const char *__file, int __oflag, ...), open64)
     __nonnull ((1));
# else
#  define open open64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int open64 (const char *__file, int __oflag, ...) __nonnull ((1));
#endif
Run Code Online (Sandbox Code Playgroud)

即使添加了#define __USE_ATFILE,函数openat/openat64也会遇到同样的问题.我不知道这些发生了什么.

kel*_*tar 5

LARGEFILE64的正确定义标志是_LARGEFILE64_SOURCE.所有的__USE_*操作都被撤消了features.h.