[{"id":29020,"web_url":"https://patchwork.libcamera.org/comment/29020/","msgid":"<171101287961.252503.978689362486897023@ping.linuxembedded.co.uk>","date":"2024-03-21T09:21:19","subject":"Re: [PATCH] v4l2: unset _TIME_BITS in addition to _FILE_OFFSET_BITS","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Steve, Dylan,\n\nQuoting Dylan Aïssi (2024-03-20 16:58:40)\n> From: Steve Langasek <steve.langasek@canonical.com>\n> \n> libcamera fails to build from source in Debian/Ubuntu on 32-bit\n> architectures under 64-bit time_t (to avoid the 'year 2038\n> problem'), because its v4l2 module legitimately un-sets\n> _FILE_OFFSET_BITS for building but this is not allowed without\n> also unsetting _TIME_BITS.\n> \n> Having verified that nothing in this module is sensitive to 64-bit\n> time_t (none of the functions it intercepts handle time), we also\n> unset _TIME_BITS to allow this to build as before.\n\nShould we be setting -D_TIME_BITS=32 or anything like that, in the same\nway that immediately after unsetting _FILE_OFFSET_BITS we set that to\n32?\n\n--\nKieran\n\n\n> Signed-off-by: Steve Langasek <steve.langasek@canonical.com>\n> Reviewed-by: Dylan Aïssi <dylan.aissi@collabora.com>\n> ---\n>  src/v4l2/meson.build | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> index e88e0b33..12d1e2a4 100644\n> --- a/src/v4l2/meson.build\n> +++ b/src/v4l2/meson.build\n> @@ -23,6 +23,7 @@ v4l2_compat_cpp_args = [\n>      # file operations, disable transparent large file support.\n>      '-U_FILE_OFFSET_BITS',\n>      '-D_FILE_OFFSET_BITS=32',\n> +    '-U_TIME_BITS',\n>      '-D_LARGEFILE64_SOURCE',\n>      '-fvisibility=hidden',\n>  ]\n> -- \n> 2.30.2\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3D980BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 21 Mar 2024 09:21:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E6D9F63055;\n\tThu, 21 Mar 2024 10:21:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 45B2F61C59\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Mar 2024 10:21:22 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3924D7E9;\n\tThu, 21 Mar 2024 10:20:54 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"A+ljj9U3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1711012854;\n\tbh=IQQWwpLy1WtA08tiWnFSfjJriRzGA9dNZd7wC1VdeFE=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=A+ljj9U3PJukH+wVF2VviJgJw0N1Voe690sFacmJpfSeFY0xYq7wQKNN1bjNbPIaF\n\tFe7lbW7ct9c+HML3+nAVtuMHB0bNcSTDR1jocqmj0SlElWh5/L8xl+XDZgU17q0vER\n\ttI88klFC0hRG3MqT3Hm3cC7Oa42TOxTkDZI/1LEo=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240320165840.35902-1-dylan.aissi@collabora.com>","References":"<20240320165840.35902-1-dylan.aissi@collabora.com>","Subject":"Re: [PATCH] v4l2: unset _TIME_BITS in addition to _FILE_OFFSET_BITS","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Steve Langasek <steve.langasek@canonical.com>, Dylan =?utf-8?b?QcOv?=\n\t=?utf-8?q?ssi?= <dylan.aissi@collabora.com>","To":"Dylan =?utf-8?b?QcOvc3Np?= <dylan.aissi@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 21 Mar 2024 09:21:19 +0000","Message-ID":"<171101287961.252503.978689362486897023@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29047,"web_url":"https://patchwork.libcamera.org/comment/29047/","msgid":"<Zf4LxmvqEx90LuMV@homer.dodds.net>","date":"2024-03-22T22:52:54","subject":"Re: [PATCH] v4l2: unset _TIME_BITS in addition to _FILE_OFFSET_BITS","submitter":{"id":193,"url":"https://patchwork.libcamera.org/api/people/193/","name":"Steve Langasek","email":"steve.langasek@ubuntu.com"},"content":"On Thu, Mar 21, 2024 at 09:21:19AM +0000, Kieran Bingham wrote:\n> Hi Steve, Dylan,\n\n> Quoting Dylan Aïssi (2024-03-20 16:58:40)\n> > From: Steve Langasek <steve.langasek@canonical.com>\n\n> > libcamera fails to build from source in Debian/Ubuntu on 32-bit\n> > architectures under 64-bit time_t (to avoid the 'year 2038\n> > problem'), because its v4l2 module legitimately un-sets\n> > _FILE_OFFSET_BITS for building but this is not allowed without\n> > also unsetting _TIME_BITS.\n\n> > Having verified that nothing in this module is sensitive to 64-bit\n> > time_t (none of the functions it intercepts handle time), we also\n> > unset _TIME_BITS to allow this to build as before.\n\n> Should we be setting -D_TIME_BITS=32 or anything like that, in the same\n> way that immediately after unsetting _FILE_OFFSET_BITS we set that to\n> 32?\n\nNo, there's no need to set it to another value.  The default behavior is for\nit to be unset.  If some libc implementation other than glibc wants to set\nit to a value other than 64, that's the business of that implementation.\n\nI don't know why you're setting -D_FILE_OFFSET_BITS=32 either fwiw and think\nthis is probably wrong, but I was going for a minimal fix here for the\nTIME/FILE bits incompatibility.\n\n> > Signed-off-by: Steve Langasek <steve.langasek@canonical.com>\n> > Reviewed-by: Dylan Aïssi <dylan.aissi@collabora.com>\n> > ---\n> >  src/v4l2/meson.build | 1 +\n> >  1 file changed, 1 insertion(+)\n> > \n> > diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> > index e88e0b33..12d1e2a4 100644\n> > --- a/src/v4l2/meson.build\n> > +++ b/src/v4l2/meson.build\n> > @@ -23,6 +23,7 @@ v4l2_compat_cpp_args = [\n> >      # file operations, disable transparent large file support.\n> >      '-U_FILE_OFFSET_BITS',\n> >      '-D_FILE_OFFSET_BITS=32',\n> > +    '-U_TIME_BITS',\n> >      '-D_LARGEFILE64_SOURCE',\n> >      '-fvisibility=hidden',\n> >  ]\n> > -- \n> > 2.30.2\n> >\n> \n\nCheers,","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3DCB8BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 22 Mar 2024 23:21:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3297B63055;\n\tSat, 23 Mar 2024 00:21:51 +0100 (CET)","from smtp-relay-canonical-1.canonical.com\n\t(smtp-relay-canonical-1.canonical.com [185.125.188.121])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E05A61C45\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Mar 2024 23:52:57 +0100 (CET)","from homer.dodds.net (1.general.vorlon.us.vpn [10.172.64.74])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id\n\t8138A3F3B6; Fri, 22 Mar 2024 22:52:56 +0000 (UTC)","by homer.dodds.net (Postfix, from userid 1000)\n\tid 606F217B4; Fri, 22 Mar 2024 15:52:54 -0700 (PDT)"],"Date":"Fri, 22 Mar 2024 15:52:54 -0700","From":"Steve Langasek <steve.langasek@ubuntu.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Dylan =?iso-8859-1?q?A=EFssi?= <dylan.aissi@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] v4l2: unset _TIME_BITS in addition to _FILE_OFFSET_BITS","Message-ID":"<Zf4LxmvqEx90LuMV@homer.dodds.net>","References":"<20240320165840.35902-1-dylan.aissi@collabora.com>\n\t<171101287961.252503.978689362486897023@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha512;\n\tprotocol=\"application/pgp-signature\"; boundary=\"mcR8+gr6t2aBLvWN\"","Content-Disposition":"inline","In-Reply-To":"<171101287961.252503.978689362486897023@ping.linuxembedded.co.uk>","X-Mailman-Approved-At":"Sat, 23 Mar 2024 00:21:49 +0100","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29072,"web_url":"https://patchwork.libcamera.org/comment/29072/","msgid":"<171146116653.2108906.5356683811864490389@ping.linuxembedded.co.uk>","date":"2024-03-26T13:52:46","subject":"Re: [PATCH] v4l2: unset _TIME_BITS in addition to _FILE_OFFSET_BITS","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Steve Langasek (2024-03-22 22:52:54)\n> On Thu, Mar 21, 2024 at 09:21:19AM +0000, Kieran Bingham wrote:\n> > Hi Steve, Dylan,\n> \n> > Quoting Dylan A�ssi (2024-03-20 16:58:40)\n> > > From: Steve Langasek <steve.langasek@canonical.com>\n> \n> > > libcamera fails to build from source in Debian/Ubuntu on 32-bit\n> > > architectures under 64-bit time_t (to avoid the 'year 2038\n> > > problem'), because its v4l2 module legitimately un-sets\n> > > _FILE_OFFSET_BITS for building but this is not allowed without\n> > > also unsetting _TIME_BITS.\n> \n> > > Having verified that nothing in this module is sensitive to 64-bit\n> > > time_t (none of the functions it intercepts handle time), we also\n> > > unset _TIME_BITS to allow this to build as before.\n> \n> > Should we be setting -D_TIME_BITS=32 or anything like that, in the same\n> > way that immediately after unsetting _FILE_OFFSET_BITS we set that to\n> > 32?\n> \n> No, there's no need to set it to another value.  The default behavior is for\n> it to be unset.  If some libc implementation other than glibc wants to set\n> it to a value other than 64, that's the business of that implementation.\n> \n> I don't know why you're setting -D_FILE_OFFSET_BITS=32 either fwiw and think\n> this is probably wrong, but I was going for a minimal fix here for the\n> TIME/FILE bits incompatibility.\n\nI would suspect it's because we're implementing a kernel interface in\nuserspace, and we only implement a single version (32 bit). But that's\nspeculation - and probably Paul would know more.\n\n Cc: Paul\n\n \n> > > Signed-off-by: Steve Langasek <steve.langasek@canonical.com>\n> > > Reviewed-by: Dylan A�ssi <dylan.aissi@collabora.com>\n\nWell, if you're sure the default is sufficient, I don't object to adding\nthis flag so:\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> > > ---\n> > >  src/v4l2/meson.build | 1 +\n> > >  1 file changed, 1 insertion(+)\n> > > \n> > > diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> > > index e88e0b33..12d1e2a4 100644\n> > > --- a/src/v4l2/meson.build\n> > > +++ b/src/v4l2/meson.build\n> > > @@ -23,6 +23,7 @@ v4l2_compat_cpp_args = [\n> > >      # file operations, disable transparent large file support.\n> > >      '-U_FILE_OFFSET_BITS',\n> > >      '-D_FILE_OFFSET_BITS=32',\n> > > +    '-U_TIME_BITS',\n> > >      '-D_LARGEFILE64_SOURCE',\n> > >      '-fvisibility=hidden',\n> > >  ]\n> > > -- \n> > > 2.30.2\n> > >\n> > \n> \n> Cheers,\n> -- \n> Steve Langasek                   Give me a lever long enough and a Free OS\n> Debian Developer                   to set it on, and I can move the world.\n> Ubuntu Developer                                   https://www.debian.org/\n> slangasek@ubuntu.com                                     vorlon@debian.org","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 254B1BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Mar 2024 13:52:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3DA4F63311;\n\tTue, 26 Mar 2024 14:52:52 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0BEEE63037\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Mar 2024 14:52:50 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3E30A497;\n\tTue, 26 Mar 2024 14:52:18 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"nEeV37VO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1711461138;\n\tbh=sArC9EkLeICHMEilKrP7nFDp4K79DQ6c3SnG4m6ycfA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=nEeV37VOdwq5sWMWBg1t57eEXPkiBuKt4gI8cZZiCOfV2Pv1kS5wkDgrWXswzD7Y4\n\tD7jtP5YgCpofMzJO2AD8252YLBJCRfKKM/MM5wau9vu5LUcfpfA1d1Akx5ACRAhYC/\n\tVit2rJuDQ0i4Bf7xJvgooCZV5obOXbNaoCWRKEDI=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<Zf4LxmvqEx90LuMV@homer.dodds.net>","References":"<20240320165840.35902-1-dylan.aissi@collabora.com>\n\t<171101287961.252503.978689362486897023@ping.linuxembedded.co.uk>\n\t<Zf4LxmvqEx90LuMV@homer.dodds.net>","Subject":"Re: [PATCH] v4l2: unset _TIME_BITS in addition to _FILE_OFFSET_BITS","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Dylan =?utf-8?b?QcOvc3Np?= <dylan.aissi@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","To":"Steve Langasek <steve.langasek@ubuntu.com>","Date":"Tue, 26 Mar 2024 13:52:46 +0000","Message-ID":"<171146116653.2108906.5356683811864490389@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29074,"web_url":"https://patchwork.libcamera.org/comment/29074/","msgid":"<20240326222153.GA14986@pendragon.ideasonboard.com>","date":"2024-03-26T22:21:53","subject":"Re: [PATCH] v4l2: unset _TIME_BITS in addition to _FILE_OFFSET_BITS","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Mar 26, 2024 at 01:52:46PM +0000, Kieran Bingham wrote:\n> Quoting Steve Langasek (2024-03-22 22:52:54)\n> > On Thu, Mar 21, 2024 at 09:21:19AM +0000, Kieran Bingham wrote:\n> > > Quoting Dylan A�ssi (2024-03-20 16:58:40)\n> > > > From: Steve Langasek <steve.langasek@canonical.com>\n> > > >\n> > > > libcamera fails to build from source in Debian/Ubuntu on 32-bit\n> > > > architectures under 64-bit time_t (to avoid the 'year 2038\n> > > > problem'), because its v4l2 module legitimately un-sets\n> > > > _FILE_OFFSET_BITS for building but this is not allowed without\n> > > > also unsetting _TIME_BITS.\n> > > >\n> > > > Having verified that nothing in this module is sensitive to 64-bit\n> > > > time_t (none of the functions it intercepts handle time), we also\n> > > > unset _TIME_BITS to allow this to build as before.\n> > >\n> > > Should we be setting -D_TIME_BITS=32 or anything like that, in the same\n> > > way that immediately after unsetting _FILE_OFFSET_BITS we set that to\n> > > 32?\n> > \n> > No, there's no need to set it to another value.  The default behavior is for\n> > it to be unset.  If some libc implementation other than glibc wants to set\n> > it to a value other than 64, that's the business of that implementation.\n> > \n> > I don't know why you're setting -D_FILE_OFFSET_BITS=32 either fwiw and think\n> > this is probably wrong, but I was going for a minimal fix here for the\n> > TIME/FILE bits incompatibility.\n> \n> I would suspect it's because we're implementing a kernel interface in\n> userspace, and we only implement a single version (32 bit).\n\nWe're intercepting both the 32-bit and 64-bit calls.\n\nThe glibc documentation\n(https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html)\nstates\n\n\nMacro: _FILE_OFFSET_BITS\n\n    This macro determines which file system interface shall be used, one\n    replacing the other. Whereas _LARGEFILE64_SOURCE makes the 64 bit\n    interface available as an additional interface, _FILE_OFFSET_BITS\n    allows the 64 bit interface to replace the old interface.\n\n    If _FILE_OFFSET_BITS is defined to the value 32, the 32 bit\n    interface is used and types like off_t have a size of 32 bits on 32\n    bit systems.\n\n    If the macro is defined to the value 64, the large file interface\n    replaces the old interface. I.e., the functions are not made\n    available under different names (as they are with\n    _LARGEFILE64_SOURCE). Instead the old function names now reference\n    the new functions, e.g., a call to fseeko now indeed calls fseeko64.\n\n    If the macro is not defined it currently defaults to 32, but this\n    default is planned to change due to a need to update time_t for\n    Y2038 safety, and applications should not rely on the default.\n\n    This macro should only be selected if the system provides mechanisms\n    for handling large files. On 64 bit systems this macro has no effect\n    since the *64 functions are identical to the normal functions.\n\n    This macro was introduced as part of the Large File Support\n    extension (LFS).\n\n\nI think setting it to 32 explicitly is right in this case, as we do not\nwant glibc to redirect the 32 bit function calls to the 64 bit API. See\nfor instance how open() is handled:\n\n#ifndef __USE_FILE_OFFSET64\nextern int open (const char *__file, int __oflag, ...) __nonnull ((1));\n#else\n# ifdef __REDIRECT\nextern int __REDIRECT (open, (const char *__file, int __oflag, ...), open64)\n     __nonnull ((1));\n# else\n#  define open open64\n# endif\n#endif\n\nwhere __USE_FILE_OFFSET64 is an internal macro that is defined i\n_FILE_OFFSET_BITS==64. In that case, the libcamera function that\nintercepts open() will be renamed to open64() by\n\n#  define open open64\n\n(_REDIRECT does something similar) and that would clash with the\nredirection of open64().\n\nToday we could leave _FILE_OFFSET_BITS undefined, but when the default\nbehaviour changes tomorrow, we'll see breakages.\n\n> But that's\n> speculation - and probably Paul would know more.\n> \n>  Cc: Paul\n>  \n> > > > Signed-off-by: Steve Langasek <steve.langasek@canonical.com>\n> > > > Reviewed-by: Dylan A�ssi <dylan.aissi@collabora.com>\n> \n> Well, if you're sure the default is sufficient, I don't object to adding\n> this flag so:\n> \n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> > > > ---\n> > > >  src/v4l2/meson.build | 1 +\n> > > >  1 file changed, 1 insertion(+)\n> > > > \n> > > > diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> > > > index e88e0b33..12d1e2a4 100644\n> > > > --- a/src/v4l2/meson.build\n> > > > +++ b/src/v4l2/meson.build\n> > > > @@ -23,6 +23,7 @@ v4l2_compat_cpp_args = [\n> > > >      # file operations, disable transparent large file support.\n> > > >      '-U_FILE_OFFSET_BITS',\n> > > >      '-D_FILE_OFFSET_BITS=32',\n> > > > +    '-U_TIME_BITS',\n> > > >      '-D_LARGEFILE64_SOURCE',\n\nLet's keep these alphabetically sorted, moving _TIME_BITS after\n_LARGEFILE64_SOURCE. I'll change this when applying the patch, no need\nto resubmit.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> > > >      '-fvisibility=hidden',\n> > > >  ]","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 05FD3BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Mar 2024 22:22:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 31EBD61C40;\n\tTue, 26 Mar 2024 23:22:03 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D9EDD61C37\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Mar 2024 23:22:01 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9F0F7497;\n\tTue, 26 Mar 2024 23:21:29 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"fK4rKT8s\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1711491689;\n\tbh=tO+BdDojD1dZ6v7pvsuNOa57VL0HINql6TG7m8ewimk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=fK4rKT8sQ3nEkOw37wArgjX+kFoiugZjY6W068xfvqvirZrn1xZjT+PL+qMvFP/Nw\n\tXF7Dy2iKPCfGF1eYUXbpM8Y4dHCeYqCJu/tbgN6IS4x4lhefUxX1xlyKsF6zkoCqNU\n\tJ0hOgVlkJLePtIGATniiHUNp1uAAUhMaJvBcDDBs=","Date":"Wed, 27 Mar 2024 00:21:53 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Steve Langasek <steve.langasek@ubuntu.com>, Dylan =?utf-8?b?QcOvc3Np?=\n\t<dylan.aissi@collabora.com>,  libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] v4l2: unset _TIME_BITS in addition to _FILE_OFFSET_BITS","Message-ID":"<20240326222153.GA14986@pendragon.ideasonboard.com>","References":"<20240320165840.35902-1-dylan.aissi@collabora.com>\n\t<171101287961.252503.978689362486897023@ping.linuxembedded.co.uk>\n\t<Zf4LxmvqEx90LuMV@homer.dodds.net>\n\t<171146116653.2108906.5356683811864490389@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<171146116653.2108906.5356683811864490389@ping.linuxembedded.co.uk>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]