From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [PATCH RFC] Large file support (LFS) for can-utils
Date: Fri, 21 Feb 2014 22:37:01 +0100 [thread overview]
Message-ID: <20140221213701.GP6988@pengutronix.de> (raw)
In-Reply-To: <5307B530.4010505@hartkopp.net>
Hello Oliver,
On Fri, Feb 21, 2014 at 09:21:04PM +0100, Oliver Hartkopp wrote:
> yesterday I tried to create a really big CAN logfile with
>
> candump -l any
>
> logging 9 CAN interfaces.
>
> But unfortunately the length of the log file on my 32 bit i686 machine was
> limited to 2147483647 == 0x7FFFFFFF == int32 max ...
>
> I did some investigation and there's some kind of large file support (LFS) in
> recent gnu libraries that allow 32 bit applications to create large files with
> file length values > 0x7FFFFFFF when the filesystem supports it.
>
> When applying the patch below my candump was able to create a large log file.
>
> Alternatively
>
> candump -L any > filename
>
> did the job too as obviously 'cat' has large file support ;-)
<pedantic>
There is no cat involved, > is handled by your shell.
</pedantic>
Doesn't really make a difference though.
> What do you think about LFS?
> Would this be the correct way to add the LFS support?
Maybe:
CFLAGS += $(getconf LFS_CFLAGS)
LDFLAGS += $(getconf LFS_LDFLAGS)
but on the other hand autoconf does it differently, they set
_FILE_OFFSET_BITS=64
only if it's needed (assuming I understood that autoconf m4 stuff
correctly). Also LDFLAGS are not handled at all by autoconf.
> diff --git a/Makefile b/Makefile
> index ab99746..a926177 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -45,6 +45,7 @@ MAKEFLAGS = -k
>
> CFLAGS = -O2 -Wall -Wno-parentheses -Iinclude \
> -fno-strict-aliasing \
> + -D_FILE_OFFSET_BITS=64 \
> -DSO_RXQ_OVFL=40 \
> -DPF_CAN=29 \
> -DAF_CAN=PF_CAN
>
-DVAR=VAL should better go into CPPFLAGS.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
prev parent reply other threads:[~2014-02-21 21:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-21 20:21 [PATCH RFC] Large file support (LFS) for can-utils Oliver Hartkopp
2014-02-21 20:36 ` Oliver Hartkopp
2014-02-21 21:37 ` Uwe Kleine-König [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140221213701.GP6988@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=socketcan@hartkopp.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.