Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9751E98E-025B-4E32-9EDF-D1984F998C10@wilcox-tech.com>
Date: Sat, 1 Jul 2023 20:18:42 -0500
From: "A. Wilcox" <AWilcox@...cox-tech.com>
To: musl@...ts.openwall.com
Cc: libc-coord@...ts.openwall.com, Jonathan Wakely <jwakely@...hat.com>,
 Rich Felker <dalias@...c.org>, linux-man@...r.kernel.org,
 libc-alpha@...rceware.org
Subject: Re: [musl] Re: Re: regression in man pages for interfaces using loff_t

On Jun 30, 2023, at 2:46 PM, Paul Eggert <eggert@...ucla.edu> wrote:
> 
> On 2023-06-30 01:02, Jonathan Wakely wrote:
> 
>> 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.
> 
> Sorry, I missed that detail. Still, the argument stands. On legacy 32-bit platforms without -D_FILE_OFFSET_BITS=64, calls will still work if they pass null pointers to copy_file_range, a common case in my experience. The calls that don't, will get typecheck errors or warnings, and that's good enough to address the issue.
> 
> 
>> And in C++ it won't even compile unless you get the pointer
>> types exactly right (C compilers will typically allow the mismatch with
>> just a warning).
> 
> That's good! People should be using -D_FILE_OFFSET_BITS=64 if they use these functions, and the typecheck errors and/or warnings will remind them. The man pages don't need to (and shouldn't) document what happens if you call these functions on legacy 32-bit platforms without first defining _FILE_OFFSET_BITS to be 64.
> 
> 
>> People miss footnotes.
> 
> OK, let's make the point more prominently, at the start of the man page. Proposed patch attached. This patch should work for musl as well as for glibc.


The wording around "legacy" 32-bit is very concerning on my end.

_FILE_OFFSET_BITS=32 is legacy, but Linux on 32-bit systems is not.  In fact, that is why we went through all the pain of time64 in Adélie (with our musl friends) - to ensure that 32-bit hardware is fully supported and current.

New designs are still being made with 32-bit Arm chips; there are new ULP x86 32-bit SoCs, etc.

I think anyone casually browsing this documentation could get the wrong idea that 32-bit platforms "in general" are legacy and this should be clarified.

Best,
-A.

--
A. Wilcox (Sent from my iPhone)
Mac, iOS, Linux software engineer
Content of type "text/html" skipped

Download attachment "0001-off64_t-prefer-off_t-for-splice-etc.patch" of type "application/octet-stream" (8355 bytes)

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.