From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12128 invoked from network); 30 Jun 2023 08:15:16 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 30 Jun 2023 08:15:16 -0000 Received: (qmail 24308 invoked by uid 550); 30 Jun 2023 08:15:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 24260 invoked from network); 30 Jun 2023 08:15:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688112899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U9SXZ41nWzXYQGojwHmeXRkIbNNW8TxZ3Dh//tfb044=; b=dukQ/zrheyeS9P68igjaX+PKo3UzhypRAcJRd2o2OmuxUB/+DSJwwon614Kmare50p5B2o JfJ00zNLnaazhXGjoGoS0WB3fcvS78qjNsxZZ2NCKkga9QI96qa20WxNYQ9pFyNLgAnZhz 3/8gI5OclcDniZj8jZ5v01bxxh6Y1bs= X-MC-Unique: QYDq2MXtMHmf8nAwCzwJEg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688112896; x=1690704896; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U9SXZ41nWzXYQGojwHmeXRkIbNNW8TxZ3Dh//tfb044=; b=VqP77kd+7gLi+xbRLbESGwQLerWXE6NijlNgf5PC8x1siDyDFqA2nX3oormw/k9GRT kwG0FGB0JKbnKUi7KME/4cspUCBZ7EUKUKYmDwH1W/NUsK+atIpGkdZO++GVXykeg7Rm ilYLiSiaWA6eUjyqJvpg2yjvuaH/9dkjmsSDjdOeoaAgVzvNiuwJIqDB9Pes2ZcOTS+R El6JFUl61v/bH6vr4CpmaOMYlsKOs75voUveBJuCN6AS5luZ9g0nx/ArIPkGDm5qXIjZ zHKKIGa41QP9z5LgjliDcEh92DqMGK3b3DRs8bdwexw1n5Kllr5w0QtjtRukOgVt73Hh Sn+g== X-Gm-Message-State: ABy/qLbFl8aT24z5ZNdT6AdcVbkWtMG5qEvR5jKF7YJ+NRQ++lmgcPu8 DRRXrbGtgUBVHiQj9tL2kgODk3DWJL2e5zd3BUqGxPnDw2wVaVzR8nHWEsHAHPjpUeb6BmBxH1a UJlV0ds7cJZznsPY20m7oUirgC6GTE6U+R9YXkhruIQ== X-Received: by 2002:a2e:9608:0:b0:2b6:a22b:42dc with SMTP id v8-20020a2e9608000000b002b6a22b42dcmr1249804ljh.16.1688112896207; Fri, 30 Jun 2023 01:14:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlEDgdh/wR+7egI8OCeduQFdzU1TEphmhAoRE8SbDBChcmTlRGUN4CveKs787CTf44mTXZB0Waeq69cF8XjF1p4= X-Received: by 2002:a2e:9608:0:b0:2b6:a22b:42dc with SMTP id v8-20020a2e9608000000b002b6a22b42dcmr1249792ljh.16.1688112895945; Fri, 30 Jun 2023 01:14:55 -0700 (PDT) MIME-Version: 1.0 References: <20230628175329.GA16113@brightrain.aerifal.cx> <20230628191525.GS20050@brightrain.aerifal.cx> <8e65a459-a933-38b4-5f82-f7016c107d91@cs.ucla.edu> In-Reply-To: From: Jonathan Wakely Date: Fri, 30 Jun 2023 09:14:44 +0100 Message-ID: To: libc-coord@lists.openwall.com Cc: Rich Felker , linux-man@vger.kernel.org, musl@lists.openwall.com, libc-alpha@sourceware.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: [musl] Re: [libc-coord] Re: regression in man pages for interfaces using loff_t On Fri, 30 Jun 2023 at 09:02, Jonathan Wakely wrote: > > On Fri, 30 Jun 2023 at 08:11, Paul Eggert wrote: >> >> On 2023-06-28 12:15, Rich Felker wrote: >> >> > There's also the problem that off64_t is "exactly 64-bit" which makes >> > it unsuitable as an interface type for cross-platform functions where >> > one could imagine the native type being larger (rather horrifying but >> > possible). >> >> Although we won't have files with 2**63 bytes any time soon, this is the >> best argument for preferring "loff_t" to "off64_t". >> >> But come to think of it, it'd be better to document the type simply as >> "off_t", with a footnote saying the equivalent of "this assumes that on >> 32-bit glibc platforms you compile with -DFILE_OFFSET_BITS=3D64 like any >> sane person would." The intent really is off_t here, and that will >> remain true even if off_t ever widens past 64 bits. >> >> All the apps I know that use the syscalls in question simply pass >> values that fit in off_t to these functions, and this will work >> regardless of whether these apps are compiled with 64- or (horrors!) >> 32-bit off_t. Admittedly the footnote solution would not be perfect, but >> it's good enough, and it would sidestep the loff_t vs off64_t confusion. > > > For APIs like copy_file_range(2) and splice(2) the arguments are loff_t* = so you can't just "pass arguments that fit in off_t" to them. You have to g= et the pointer type correct, because writing 64-bits through a 32-bit off_t= would be bad. And in C++ it won't even compile unless you get the pointer = types exactly right (C compilers will typically allow the mismatch with jus= t a warning). > > People miss footnotes. I would really prefer if the signature shown in th= e man page used a type that will actually compile. If it shows off_t, that = won't compile for 32-bit systems without LFS support enabled. Apologies for sending the mail above as HTML - replying as text/plain for those it didn't reach.