dbz.c patch for greater than 2^31 history table files

Russ Allbery rra at stanford.edu
Sat Feb 10 22:34:05 UTC 2007


Chris Caputo <ccaputo at alt.net> writes:

> Hi.  Please review and consider the following patch to lib/dbz.c.  The
> patch does the following:

Yup, looks good.  Mostly committed.

>  - the getcore() type changes are needed to prevent memset() in getcore()  
>    from getting a negative byte count when the size of a table exceeds 
>    2^31 bytes.

>  - the putcore() changes are needed because pwrite(), and write() for that 
>    matter, may validly succeed even while writing less than actually 
>    requested.  In particular I have noticed that Linux limits write system 
>    calls to 2^31 minus pagesize bytes.  This fix is needed in order to 
>    have table sizes above that number.

Yeah, this is what xpwrite is for, and it certainly should be used here.
Changed to do so.

>  - the munmap() and msync() removal of the int typecasts doesn't address a 
>    problem I have actually experienced, but I think it is correct.  I am 
>    not sure if there will be a compilation problem due to this change on 
>    certain operating systems.

Nope, prototypes will take care of the cast if need be.  Only pre-ANSI
systems would have a problem, and we don't support those anymore anyway.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list