Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!uwvax!rutgers!ucla-cs!zen!ucbvax!decvax!hanauma!stew From: stew@hanauma.UUCP (Stewart Levin) Newsgroups: comp.unix.wizards Subject: Re: Using argv to show process status Message-ID: <116@hanauma.UUCP> Date: Thu, 27-Aug-87 12:13:06 EDT Article-I.D.: hanauma.116 Posted: Thu Aug 27 12:13:06 1987 Date-Received: Sat, 29-Aug-87 12:55:28 EDT References: <7166@ism780c.UUCP> Organization: Stanford U. Geophysics Lines: 14 Instead of having the interpreter try to rewrite argv, have it initially popen() a tiny program which has the name RUN, say. Then when the interpreter wants to show it is now performing MULT, say, it fprintf's the name MULT to the pipe and the tiny program links the name MULT to its own executable and execl's itself under that new name. Standard input remains open and the new copy waits for the next process name to come down the pipe so it can repeat the link/exec. And unlink the name MULT also, unless there are only a fixed set of possibilities. The logic of doing it with a child is that a fork and load of a tiny program is minor, asynchronous overhead, forking the interpreter is major, synchronous overhead.