[PATCH,HURD] hurd: compliance fixes for ptsname_r

Pino Toscano toscano.pino@tiscali.it
Mon Nov 19 21:58:00 GMT 2012


Hi,

Alle venerdì 20 luglio 2012, Roland McGrath ha scritto:
> > Ok, I see that its `buf' argument is marked nonnull. I added that
> > check because I saw the gnulib test for it explicitly checking
> > that ptsname_r(fd, NULL, 0) would be properly failing with EINVAL
> > (and the man page even explicitly mention that return value,
> > unlike with basically most of the other functions). Should gnulib
> > do that check only on Linux, then?
> 
> Well, everybody's wrong.  The libc manual never said that you can
> pass NULL and expect not to crash, and the man page was IMHO wrong
> to document it that way.  The other implementations never should
> have checked for NULL, but they have done so for a long time. 
> gnulib never should have passed NULL to this function and IMHO it
> should be fixed not to do so. But given the history, the least of
> avaialble evils is to make the Hurd implementation consistent with
> the others and do the check.

(few months later... I forgot I sent this patch, so I'm bring it again.)

I updated the patch; is it okay to commit, or should I bring back the 
buf==NULL check?

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hurd_ptsname.diff
Type: text/x-patch
Size: 1691 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20121119/85e7efb4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20121119/85e7efb4/attachment.sig>


More information about the Libc-alpha mailing list