Bug 205398 - [regression] [tty] tty_drain() kernel function lacks timeout support it had before
Summary: [regression] [tty] tty_drain() kernel function lacks timeout support it had b...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.3-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2015-12-18 13:43 UTC by Eugene Grosbein
Modified: 2015-12-18 16:25 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein 2015-12-18 13:43:21 UTC
Revision 181905 by ed@freebsd.org brought the new MPSAFE TTY layer and removed "drainwain" timeout support. Now applications working with serial port can hang forever on close() system call:

- an application opens /dev/cuau0 in non-blocing i/o mode and tries to detect GSM gateway there writing commands like ATZ, ATE1 etc. to the device;
- the device may be dead (lost power, broken, disconnected etc.) and does not answer back;
- application timeouts waiting for answer and closes device with close()
- tty layer tries to drain output "forever", until a signal arrives.

gnokii (comms/gnokii) suffers from this problem.

Please re-implement tunable timeout and TIOCSDRAINWAIT syscall kernel has before.