DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Terminal device control

Closing a terminal device file

The last process to close a terminal-device-file causes any output remaining to be sent to the device and any input remaining to be discarded. Following these actions, if the flag HUPCL is set in the control-modes and the communication-port supports a disconnect function, the terminal-device does a disconnect.

Because the POSIX.1 standard is silent on whether a close blocks waiting for transmission to drain, or even if a close might flush any pending output, a program concerned about how data in terminal input and output-queues are handled should call the appropriate functions such as tcdrain to ensure the desired behavior (see close(2) and tcdrain in termios(3C)).


Next topic: Special characters
Previous topic: Writing data and output processing

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004