[comp.sys.sun] stty [-]nohang

guy@uunet.uu.net (Guy Harris) (04/22/89)

>I'm a new SUN user and just brought up a 3/60 with Version 4.0.  To my
>surprise, the stty option [-]nohang was conspicuous by its absence.

An oversight, as I remember.

>This is the function that kills the control process if the remote carrier is
>dropped, thus logging out the faulted user and clearing the remote
>port.

Actually, "nohang" is the function that tells the system *not* to kill
the control process if the remote carrier is dropped.  From the
4.3-tahoe TTY(4):

	When the carrier signal from the dataset drops (usually
	because the user has hung up his terminal) a SIGHUP hangup
	signal is sent to the processes in the distinguished process
	group of the terminal; this usually causes them to terminate.
	The SIGHUP can be suppressed by setting the LNOHANG bit in the
	local state word of the driver.

"stty -nohang" tells the system to send a SIGHUP to all processes in the
process group of the terminal (basically, all processes in the
foreground job, at least under a job-control shell; all processes in the
session, under a non-job-control shell) when carrier goes away.  That
setting ("stty -nohang") is the default.

>An inquiry to some folks locally informed me that this option was present
>in Version 3.  Can anyone point me to a way of ressurecting [-]nohang or
>achieving the same result another way?

"stty clocal" is basically equivalent to "stty nohang" (and "stty
-clocal" is equivalent to "stty -nohang").  "stty clocal" also has the
effect that an open on the port won't wait for carrier to come up (yes,
this does work - open the port no-delay, set "clocal", then do another
open; this trick is used on occasion in S5-land).

>Try looking at the "hupcl" option of stty.  I believe you want
>"stty hupcl", but I've never verified that it actually works as
>advertised.  --wnl

Not quite.  "hupcl" is the one that works the other way around - it
controls whether carrier is dropped by the *local* machine when the last
process holding the tty closes it, not whether processes attached to the
tty are given a SIGHUP when carrier goes away.

[[ Whups!  Well.....close anyway.  --wnl ]]