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 11016 invoked from network); 19 Nov 2021 21:53:46 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 19 Nov 2021 21:53:46 -0000 Received: (qmail 28629 invoked by uid 550); 19 Nov 2021 21:53:45 -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 28597 invoked from network); 19 Nov 2021 21:53:44 -0000 Date: Fri, 19 Nov 2021 16:53:30 -0500 From: Rich Felker To: linux-man@vger.kernel.org, "Michael Kerrisk (man-pages)" Cc: musl@lists.openwall.com Message-ID: <20211119215327.GY7074@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [musl] getsubopt error behavior documentation in man page The getsubopt man page documents the return value on error as: Otherwise, -1 is returned and *valuep is the entire name[=value] string. without mentioning that this is a nonstandard extension. A couple times now this has been raised against musl libc, which does not support the extension, and we looked into supporting it, but it looks like it violates our criteria for not supporting extensions where historical implementations have conflicting behavior, which POSIX's APPLICATION USAGE notes claim: The value of *valuep when getsubopt() returns -1 is unspecified. Historical implementations provide various incompatible extensions to allow an application to access the suboption text that was not found in the keylistp array. Source: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html It's also not entirely clear that presence of the extension conforms to the specified behavior. Perhaps the text could be amended to something like: Otherwise, -1 is returned. In this case, the GNU C Library stores a pointer to the entire name[=value] string in *valuep as an extension; other implementations may differ in their behavior. Rich