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(S) and tcdrain in termios(S)).


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

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005