[PATCH] off_t size problem
mdounin at mdounin.ru
Wed Nov 9 19:53:01 UTC 2011
On Wed, Nov 09, 2011 at 04:48:38PM +0800, Simon Liu wrote:
> Nginx define _FILE_OFFSET_BITS=64 in linux platform(ngx_linux_config.h),
> and it will cause size of off_t is 8 byte. Therefore it should include
> nginx header file in starting position of other module(must be before
> <sys/types.h>), otherwise off_t will be 4 byte(32 bit system) in the
> module, this will be to cause some confusion .
> I think use gcc -D will be better.
Not really. Failing to include nginx headers before anything else
will cause other problems as well (e.g. take a look at
ngx_win32_config.h), and moving _FILE_OFFSET_BITS to compiler
arguments won't solve the problem but rather hide it.
More information about the nginx-devel