Subject: kern/3928: /dev/sound does not handle fcntl(F_SETFL)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <Anders.Hjalmarsson@economics.gu.se>
List: netbsd-bugs
Date: 07/31/1997 15:51:54
>Number:         3928
>Category:       kern
>Synopsis:       /dev/sound does not handle fcntl(F_SETFL)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 31 06:50:01 1997
>Last-Modified:
>Originator:     Anders Hjalmarsson
>Organization:
>Release:        NetBSD-current Jul-30 1997
>Environment:
NetBSD econahj1.econ.gu.se 1.2G NetBSD 1.2G (ECONAHJ1) #53: Thu Jul 31 15:15:53 MET DST 1997     econahja@econahja.econ.gu.se:/usr/src/sys/arch/i386/compile/ECONAHJ1 i386


>Description:
/dev/sound does not handle fcntl(F_SETFL) even if you set them to
the result of a previous fcntl(F_GETFL)

>How-To-Repeat:
Run the following program and see if fail in fcntl( F_SETFL )

#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>

int main()
{
	int fd, fl;

	if ((fd = open("/dev/sound", O_WRONLY, 0)) == -1) {
		perror("open");
		exit(1);
	}
	if ((fl = fcntl(fd, F_GETFL, 0)) == -1) {
		perror("fcntl F_GETFL");
		exit(1);
	}
	if (fcntl(fd, F_SETFL, fl) == -1) {
		perror("fcntl F_SETFL");
		exit(1);
	}
	exit(0);
}

>Fix:
Add case FIONBIO to audio_ioctl (/usr/src/sys/dev/audio.c), but I do not
know what it should do.
>Audit-Trail:
>Unformatted: