transferring processes under csh

Peter da Silva peter at ficc.uu.net
Thu Sep 8 20:52:26 AEST 1988


In article <2364 at pixar.UUCP>, rta at pixar.UUCP (Rick Ace) writes:
[ bunch of included text deleted ]

> Roadblocks to making ATTACH work under UNIX:
> 1. UNIX has no formal concept of a "job" and no per-job database.
>    (This is not the only approach, but it worked well for ATTACH.)

A process group matches pretty well to a 'job'.

> 2. Determining which processes belong to which terminals is a nebulous task.

There is a pointer from the terminal to the job somewhere, since a process
group is killed (with SIGHUP) when the head of that process group exits.
It may just go through the process table hitting all the jobs that have the
same pgroup as the process that exits, but there is that handle.

> 3. Processes have direct handles (file descriptors) on terminals;
>    they do not go indirect a job-common location.  About the
>    closest thing to a "controlling terminal" is /dev/tty, but
>    that's not what you'll find at stdin/stdout/stderr.

And the open routine for /dev/tty has to know about a processes control
terminal, so the information is there...

1. You create a pseudo-device that looks pretty much like /dev/null, and
   attach all the file handles that refer to the control tty of each
   process in that process group to the pseudo-device.

2. You then change the control terminal of that process group to this
   pseudo-device. Now you have all the processes isolated in a nice
   little job.

3. To re-attach, you just repeat steps one and two for the new control
   terminal.

This would require kernel hacking... and not just a device driver. But if you
put some streams between the control terminal and the process it may be
possible to do something like this without undue harm...
-- 
Peter da Silva  `-_-'  Ferranti International Controls Corporation.
"Have you hugged  U  your wolf today?"            peter at ficc.uu.net



More information about the Comp.unix.wizards mailing list