mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: linux-man@vger.kernel.org,
	"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: musl@lists.openwall.com
Subject: [musl] getsubopt error behavior documentation in man page
Date: Fri, 19 Nov 2021 16:53:30 -0500	[thread overview]
Message-ID: <20211119215327.GY7074@brightrain.aerifal.cx> (raw)

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

                 reply	other threads:[~2021-11-19 21:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211119215327.GY7074@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).