- 论坛徽章:
- 0
|
- 头文件fcntl.h里
- 71 #ifndef __USE_FILE_OFFSET64
- 72 extern int open (__const char *__file, int __oflag, ...) __nonnull ((1));
- 73 #else
- 74 # ifdef __REDIRECT
- 75 extern int __REDIRECT (open, (__const char *__file, int __oflag, ...), open64)
- 76 __nonnull ((1));
- 77 # else
- 78 # define open open64
- 79 # endif
- 80 #endif
- 81 #ifdef __USE_LARGEFILE64
- 82 extern int open64 (__const char *__file, int __oflag, ...) __nonnull ((1));
- 83 #endif
复制代码
就是说,当你定义了__USE_FILE_OFFSET64时,编译器进行预处理,如果在遇到open函数,会将其替换为open64,
然后当你同时定义了__USE_LARGEFILE64时,编译器会引入open64函数的定义.
其它的,在sys/stat.h里也是一样的.
所以,或者你定义一个公用头文件,在该文件里把这两个宏都写入.
或者你在编译时gcc -D__USE_FILE_OFFSET64 -D__USE_LARGEFILE64一如这两个宏都可以. |
|