Date: Wed, 12 Sep 2012 13:23:29 GMT From: Ed Maste <emaste@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: standards/171572: ptsname(-1) returns errno 0 Message-ID: <201209121323.q8CDNTWt085384@freefall.freebsd.org> Resent-Message-ID: <201209121330.q8CDU2Zw029565@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 171572 >Category: standards >Synopsis: ptsname(-1) returns errno 0 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Sep 12 13:30:01 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Ed Maste >Release: FreeBSD 9.0-STABLE i386 >Organization: FreeBSD >Environment: System: FreeBSD freefall.freebsd.org 9.0-STABLE FreeBSD 9.0-STABLE #6 r235139: Tue May 8 21:19:03 UTC 2012 simon@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386 >Description: ptsname(fildes) is documented to set errno to EBADF if fildes is not a valid open file descriptor, but ptsname(-1) returns errno = 0. >How-To-Repeat: ==[test-ptsname.c]== #include <errno.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { char *name; errno = 0; name = ptsname(-1); printf("ptsname(-1) returns %p (%s), errno is %d\n", name, name ? name : "", errno); } ==== [emaste@freefall ~]$ ./test-ptsname ptsname(-1) returns 0x0 (), errno is 0 >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209121323.q8CDNTWt085384>