__USE_FILE_OFFSET64 vs. _FILE_OFFSET_BITS=64

这一生的挚爱 提交于 2019-12-02 20:27:52
Sergey Vlasov

There are getconf values in IEEE Std 1003.1-2004 (and a newer set in IEEE Std 1003.1-2008; see also the EXAMPLES section in those documents). Actual compiler options (which might not even be defines) are not specified.

However, the AC_SYS_LARGEFILE macro in autoconf does not try to use this — it tries just -n32 for IRIX, -D_FILE_OFFSET_BITS=64 (which should work for most systems) and -D_LARGE_FILES=1 (apparently for AIX). There is also a reference to Adding Support for Arbitrary File Sizes to the Single UNIX Specification (an older spec draft which was then partially included in the POSIX.1 spec) in autoconf sources.

As for defining __USE_FILE_OFFSET64 manually, not sure if this is really a correct solution — double-underscore macros are reserved for system headers, and most likely there is some conditional definition there which depends on other defines.

pushkarnk

In features.h, you see the relation between _FILE_OFFSET_BITS and __USE_FILE_OFFSET64.

#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
# define __USE_FILE_OFFSET64    1
#endif

So, only _FILE_OFFSET_BITS is meant for the users.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!