public inbox for developer@lists.illumos.org (since 2011-08)
 help / color / mirror / Atom feed
From: Robert Mustacchi <rm@fingolfin.org>
To: illumos-developer <developer@lists.illumos.org>,
	Yuri Pankov <yuri@aetern.org>
Subject: Re: [developer] 16636 want ptsname_r
Date: Thu, 4 Jul 2024 06:46:09 -0700	[thread overview]
Message-ID: <5a3c353a-4126-4007-bde8-246888c7fc8f@fingolfin.org> (raw)
In-Reply-To: <e12790b3-54dd-4444-ae4e-8c3df85eed62@aetern.org>

On 7/3/24 21:22, Yuri Pankov wrote:
> Robert Mustacchi wrote:
>> https://code.illumos.org/c/illumos-gate/+/3571
>>
>> This adds a new POSIX-specified re-entrant version of ptsname().
> 
> Hi Robert,
> 
> Is there any published document for this (a draft?)?  All I could find
> is documentation in FreeBSD and Linux where "non-standard" ptsname_r()
> is setting errno in addition to returning non-0 value, and that doesn't
> seem to match what's in review, so the standard has probably changed that?

Yes, POSIX 2024 was published. I didn't want to work off a non-draft.
The web form of it seems to not have been updated by the open group yet,
but the spec is available at
https://ieeexplore.ieee.org/document/10555529, but not for free
unfortunately. There are versions of what led to it at
https://austingroupbugs.net/view.php?id=508.

I have a "If successful, the ptsname_r( ) function shall return zero.
Otherwise, an error number shall be returned to indicate the error."
with the rationale being "Historically, some versions of ptsname( ) did
not set errno even when returning a null pointer. However, ptsname_r( )
is required to either populate the buffer with a valid name or return an
error value."

Spot checking the manual page I have for ptsname_r() in Ubuntu 22.04,
this matches. Same with musl. The FreeBSD manual page is different, but
notes it's changing for POSIX compat. Does that help at all?

Robert

  reply	other threads:[~2024-07-04 13:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-04  0:16 Robert Mustacchi
2024-07-04  4:22 ` [developer] " Yuri Pankov
2024-07-04 13:46   ` Robert Mustacchi [this message]
2024-07-07 18:42     ` Alan Coopersmith

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=5a3c353a-4126-4007-bde8-246888c7fc8f@fingolfin.org \
    --to=rm@fingolfin.org \
    --cc=developer@lists.illumos.org \
    --cc=yuri@aetern.org \
    /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.
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).