lkml.org 
[lkml]   [1996]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjecttty ioctls after hangup - EIO - Why ?
Date
I've been trying to write a program to behave like the front LEDs
on an external modem, and discovered that after a hangup, ioctls
return -EIO. This is a royal pain ita.

Is there any particular reason for this ?

My program opens the serial line and keeps doing a TIOCMGET to
track the modem control lines, but after ppp hangs up, the
ioctl gives I/O error until another process opens the device.
This prevents the program giving a correct display.

I can't see a good reason why ioctls should give EIO after hangup.
So I have modified the tty fops in tty_io.c to use the same ioctl
function whether the tty is hanged (hung ?) up or not, and that cures
my problem, but is this pukka ?

If not, is there a way to reset the hangup status without closing
and reopening the device ? And if not, should there be ?

I've also added a new IOCTL to return the number of characters
transmitted and received, but this is irrelevant to the issue
being moaned about.

--
Peter Fox


\
 
 \ /
  Last update: 2005-03-22 13:36    [W:2.708 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site