ps and wall; How do they work?

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Sun Sep 16 19:53:49 AEST 1990


In article <13871 at smoke.BRL.MIL> gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
> I didn't say that the printer hadn't been logged in.  Users with hardcopy
> terminals (e.g. letter-quaility) have used them for printing nroff output
> for quite a long time now.  A side effect of a reasonable nroff with
> output sent to such a printing terminal is that the equivalent of "mesg n"
> is performed to block "write" and "wall" during printing.

Is this your argument that ``mesg'' really means to change a session
from interactive to noninteractive?

I see it as evidence that your model is flawed. The printer really
serves two entirely different purposes. The first is as an interactive
session with a user. The second is as a printer to produce
noninteractive output pages.

Obviously both uses are multiplexed through the same physical port, say
/dev/printer. The first use is handled by a pseudo-tty session, which is
marked as interactive by being listed in /etc/utmp. The second use is
handled by straight output to /dev/printer.

The only problem is that interactive output (like wall's messages) must
not be allowed to mess up noninteractive output. So whenever the printer
is under the second use, the interactive session must be temporarily
disconnected. As soon as it finishes, the session is reconnected, and
control reverts to the first use.

See? mesg/write/wall/talk/itmp (utmp) fits quite naturally into this
structure.

> All that is necessary is for "mesg" and
> "write"/"wall" to cooperate.

They already do.

---Dan



More information about the Comp.unix.questions mailing list