Subject: kern/12048: interrupted TIOCSETAW returns with ENOTTY
To: None <>
From: None <>
List: netbsd-bugs
Date: 01/26/2001 04:43:33
>Number:         12048
>Category:       kern
>Synopsis:       interrupted TIOCSETAW returns with ENOTTY
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 26 04:46:01 PST 2001
>Release:        1.4.1, 1.5, 1.5K, 1.5Q
	Internet Initiative Japan Inc.
System: NetBSD 1.5K NetBSD 1.5K (RTINIT) #20: Fri Nov 24 04:43:17 JST 2000 i386
Architecture: i386
Machine: i386
	Interrupted TIOCSETAW returns with ENOTTY
	when SIGINT handler is installed.

	Configure the host as a serial-console terminal(9600bps),
	and login on its serial console.
	Execute following program and type Ctrl-C when you see "Fire!"

#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <termios.h>

void intr(int);
int main(int, char **);

intr(int signo)

main(int ac, char **av)
	int rv;
	int i;

	siginterrupt(SIGINT, 0);
	signal(SIGINT, intr);

	for( i = 0; i < 20; i++ ){
		if( i == 16 )

	rv = tcdrain(1);
	if( rv == -1 )
		printf("tcdrain() = %d, errno = %d\n", rv, errno);
		printf("tcdrain() = %d\n", rv);


	return 0;

	problem has been already fixed in FreeBSD: