standards/94729: fcntl() throws undocumented ENOTTY

Volker Stolz vs at FreeBSD.org
Mon Mar 20 11:10:16 UTC 2006


>Number:         94729
>Category:       standards
>Synopsis:       fcntl() throws undocumented ENOTTY
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-standards
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 20 11:10:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Volker Stolz
>Release:        FreeBSD 6.1-BETA3 i386
>Organization:
Lehrstuhl für Informatik II; RWTH Aachen (c) Universität
>Environment:
System: FreeBSD menelaos.informatik.rwth-aachen.de 6.1-BETA3 FreeBSD 6.1-BETA3 #1: Mon Mar 13 10:45:03 CET 2006 root at menelaos.informatik.rwth-aachen.de:/usr/obj/usr/src/sys/MENELAOS i386


>Description:
When trying to set non-blocking IO on e.g. /dev/null, ENOTTY is returned.
This is neither documented in the FreeBSD man page nor behaviour covered by
IEEE Std 1003.1-2001.
>From browsing our bug-tracker, there seem to be several instances of third-party
software (mostly in ports) which required FreeBSD-specific patches.
I understand that the Posix-description doesn't give us an easy way out, but we should
at least document this in our own man page.
>How-To-Repeat:
Run the program below, redirecting input from /dev/null:

./a.out </dev/null
yikes!: Inappropriate ioctl for device

>Fix:
Unknown; should at least be documented.
Maybe setting O_NONBLOCK on /dev/null should not fail?

--- fcntltest.c begins here ---
#include <fcntl.h>
#include <stdio.h>

void main() {
	if (fcntl(0,F_SETFL,O_NONBLOCK) != 0)
		perror("yikes!");
	return 0;
}
--- fcntltest.c ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-standards mailing list