[15265] in Athena Bugs
Solaris fdopen(3)
daemon@ATHENA.MIT.EDU (Dan Winship)
Mon Jul 14 17:35:32 1997
Date: Mon, 14 Jul 1997 17:35:26 -0400 (EDT)
From: danw@MIT.EDU (Dan Winship)
To: bugs@MIT.EDU
from man fdopen:
The function fdopen() returns a null pointer if fildes is
not an open file descriptor, or if type is invalid, or if
the file cannot be opened.
but...
danw@technomage:tmp> more foo.c
#include <stdio.h>
main()
{
if (fdopen(-1, "w") != NULL) printf("bug!\n");
}
danw@technomage:tmp> cc -o foo foo.c
danw@technomage:tmp> ./foo
bug!
This is in 2.4 and 2.5.1.
-- Dan