This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: ptsname_r
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