[Dnsmasq-discuss] dnsmasq isn't happy when log file reaches 2GB?
Simon Kelley
simon at thekelleys.org.uk
Mon Apr 14 14:19:09 BST 2008
Matthias Andree wrote:
> Simon Kelley <simon at thekelleys.org.uk> writes:
>
>> Paul Chambers wrote:
>>> Rune Kock wrote:
>>>
>>>> On Fri, Mar 28, 2008 at 1:34 AM, Paul Chambers <bod at bod.org> wrote:
>>>>
>>>>
>>>>> Does dnsmasq have a problem when the file it's logging to reaches two
>>>>> gigabytes?
>>>>>
>>>> Are you using FAT or some equally horrible file system?
>>>>
>>> noooo.... I'm not that big an idiot ;) it's an ext3 filesystem, on a
>>> 3ware RAID card.
>> Looks like, on Linux, we need to open the file with O_LARGEFILE. From
>> "man 2 open":
>>
>> O_LARGEFILE
>> (LFS) Allow files whose sizes cannot be represented in an
>> off_t (but can be represented in an off64_t) to be opened.
>>
>>
>> I'll add the fix.
>
> That's probably the wrong way to do it, better
>
> #define _LARGEFILE_SOURCE 1
> #define _FILE_OFFSET_BITS 64
>
> or the equivalent on the compiler and linker command lines - the
> canonical way to obtain these flags would be to use getconf(1) to query
> LFS_CFLAGS, LFS_LIBS, LFS_LDFLAGS.
>
> This works at least on Solaris and Linux.
>
That works, thanks.
Cheers,
Simon.
More information about the Dnsmasq-discuss
mailing list