Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!mhres!jv From: jv@mhres.mh.nl (Johan Vromans) Newsgroups: comp.unix.wizards Subject: Re: Using argv to show process status Message-ID: <1229@mhres.mh.nl> Date: Sat, 22-Aug-87 12:47:32 EDT Article-I.D.: mhres.1229 Posted: Sat Aug 22 12:47:32 1987 Date-Received: Sun, 23-Aug-87 12:23:12 EDT References: <1217@mhres.mh.nl> <6303@brl-smoke.ARPA> <1224@mhres.mh.nl> <7164@ism780c.UUCP> Organization: Multihouse N.V., The Netherlands Lines: 37 In article <7164@ism780c.UUCP> mikep@ism780c.UUCP (Michael A. Petonic) writes: >In article <1224@mhres.mh.nl> jv@mh.nl (Johan Vromans) writes: >}We are running a kind of interpreter for a programming language in which >}lots of applications have been written. One of the features of the >}language is that a program can chain to a successor program. Chains are >}handled internally by the interpreter, no new process is started. >} >}When a user starts an application with "RUN menu", and menu chains to different >}application programs which all chain back to menu for the next choice, >}the "ps" will always show the "RUN menu" command. > > >Well, how about making links to small C programs that would "RUN Menu" >(or a shell script) and then arv[0] would be the name of the link. Apparently you missed the point. There is a "real" program (the interpreter) and lots of "pseudo" programs (programs written for the interpreter). The user invokes the interpreter and specifies which pseudo program to execute. This pseudo program chains to other (pseudo) programs. During this process, the interpreter stays resident. For the user, the pseudo program is what he is running; for ps it's the interpreter. By clobbing argv, it is possible to reveal in a ps display which pseudo program the interpreter is currently executing. This can be important in situations where the system manager has to decide whether a user task can be killed safely. Currently there is no way for the system administrator to find out who is doing what. Clobbing argv supplies a method which works on at least some systems (the BSD type systems). For other systems, other methods must be used. -- Johan Vromans | jv@mh.nl via European backbone Multihouse N.V., Gouda, the Netherlands | uucp: ..{seismo!}mcvax!mh.nl!jv "It is better to light a candle than to curse the darkness"