public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: ptsname_r
Date: Tue, 08 Nov 2011 05:56:00 -0000	[thread overview]
Message-ID: <20111108055623.GB11449@ednor.casa.cgf.cx> (raw)
In-Reply-To: <4EB843B4.4030605@redhat.com>

On Mon, Nov 07, 2011 at 01:46:44PM -0700, Eric Blake wrote:
>On 11/07/2011 01:45 PM, Eric Blake wrote:
>> On 11/07/2011 12:35 PM, Christopher Faylor wrote:
>>> On Mon, Nov 07, 2011 at 12:14:01PM -0700, Eric Blake wrote:
>>>> Since ptsname() is not thread-safe on all platforms, it would be nice if
>>>> cygwin could also export ptsname_r() to match glibc.
>>>>
>>>> If no one beats me to it, I'll try and submit patches this week.
>>>
>>> I'll do it. I've been in this code recently so it's fresh in my mind.
>>
>> Thanks. Also, even with your patches of today, ptsname() is still not
>> thread-safe; should we be sticking that in a thread-local buffer rather
>> than in static storage, similar to how other functions like strerror()
>> are thread-safe?
>
>Also, should we have an efault handler in syscalls.cc ptsname_r(), 
>similar to ttyname_r(), so as to gracefully reject invalid buffers 
>rather than faulting?

I actually carefully followed exactly what was described in the Linux
man page.  If you pass an invalid pointer to ptsname_r on Linux it seg
faults.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2011-11-08  5:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07 19:14 ptsname_r Eric Blake
2011-11-07 19:35 ` ptsname_r Christopher Faylor
2011-11-07 20:46   ` ptsname_r Eric Blake
2011-11-07 20:46     ` ptsname_r Eric Blake
2011-11-08  5:56       ` Christopher Faylor [this message]
2011-11-08  5:53     ` ptsname_r Christopher Faylor

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=20111108055623.GB11449@ednor.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@cygwin.com \
    --cc=cygwin@cygwin.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).