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=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26315 invoked from network); 13 Sep 2020 14:18:31 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 13 Sep 2020 14:18:31 -0000 Received: (qmail 25796 invoked by uid 550); 13 Sep 2020 14:18:24 -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 25775 invoked from network); 13 Sep 2020 14:18:23 -0000 Date: Sun, 13 Sep 2020 10:18:11 -0400 From: Rich Felker To: =?utf-8?B?w4lyaWNv?= Rolim Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, musl@lists.openwall.com, ericonr@disroot.org Message-ID: <20200913141808.GM3265@brightrain.aerifal.cx> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [patch] posix_fallocate.3: add note about error codes for musl. On Sun, Sep 13, 2020 at 05:06:25AM -0300, Érico Rolim wrote: > As can be seen in > > https://git.musl-libc.org/cgit/musl/tree/src/fcntl/posix_fallocate.c?id=73cc775bee53300c7cf759f37580220b18ac13d3 > > musl returns the syscall's errors directly, which means it doesn't > perform the same emulation as glibc, and, more relevant to this change, > it can return more errors than the ones currently listed in ERRORS. > --- > man3/posix_fallocate.3 | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/man3/posix_fallocate.3 b/man3/posix_fallocate.3 > index 58338d673..2e440b3e1 100644 > --- a/man3/posix_fallocate.3 > +++ b/man3/posix_fallocate.3 > @@ -101,6 +101,10 @@ referred to by > .B ESPIPE > .I fd > refers to a pipe. > +.TP > +Libraries that don't perform the emulation shown in NOTES, such as musl libc, > +may also return the error codes listed in > +.BR fallocate (2). > .SH VERSIONS > .BR posix_fallocate () > is available since glibc 2.1.94. > -- > 2.28.0 I think this should be documented the other way around -- adding EOPNOTSUPP to the list of errors, with a note that applications may not see the error due to emulation by glibc, but should be prepared to handle it. The emulation glibc does is highly unsafe (can corrupt the file -- see https://sourceware.org/bugzilla/show_bug.cgi?id=15661) and the only reason it wasn't removed was that software had come to rely on it being there, in part due to lack of documentation otherwise. If that's fixed, it's possible that glibc could eventually fix this bug with a new symbol version. Rich