Welcome! Log In Create A New Profile

Advanced

[PATCH] off_t size problem

Simon Liu
November 09, 2011 03:50AM
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.

this is my patch:

Index: auto/os/linux
=================================================================== ---
auto/os/linux (revision 4267) +++ auto/os/linux (working copy) @@ -15,6
+15,9 @@ CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
+CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" + + # Linux kernel version
version=$((`uname -r \ Index: src/os/unix/ngx_linux_config.h
=================================================================== ---
src/os/unix/ngx_linux_config.h (revision 4267) +++
src/os/unix/ngx_linux_config.h (working copy) @@ -12,7 +12,6 @@ #define
_GNU_SOURCE /* pread(), pwrite(), gethostname() */ #endif -#define
_FILE_OFFSET_BITS 64 #include <sys/types.h> #include <sys/time.h>



--
douban:www.douban.com/people/mustang/

blog: www.pagefault.info

twitter: www.twitter.com/minibobo

weibo: www.weibo.com/diaoliang
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] off_t size problem

Simon Liu 2277 November 09, 2011 03:50AM

Re: [PATCH] off_t size problem

Maxim Dounin 1016 November 09, 2011 02:54PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 289
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready