Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!mintaka!spdcc!tauxersvilli!alphalpha!nazgul From: nazgul@alphalpha.com (Kee Hinckley) Newsgroups: comp.sys.apollo Subject: Re: How do you give a fork()ed process a name? Keywords: fork pst sr9 Message-ID: <1990Sep24.134911.4145@alphalpha.com> Date: 24 Sep 90 13:49:11 GMT References: <1729@m1.cs.man.ac.uk> Organization: asi Lines: 42 In article <1729@m1.cs.man.ac.uk> dente@els.ee.man.ac.uk (Colin Dente) writes: >uid (dspst shows it as an 'unknown'). Is there any way of giving the process >a sensible name? (where *does* aegis keep it's process names?). You can probably turn this into a subroutine in your program if you want (of course there's a system call to do this but I don't recall what it's called, proc2_$xxx or something like that). This has been posted before I believe, but... #!/com/sh eon SYSTYPE := bsd4.2 export SYSTYPE abtsev -max /bin/ps -axN | /com/chpat -o -a -p 'uid = {[~ ]*}?*[0-9]:[0-9][0-9] {[~ ]*}?*' '@1 @2' @ | while read uid pname do args ^uid | /com/chpat '.' ' ' | read hi lo args ^pname | /com/chpat '?*/' '' | read pname cnt := 1 oldname := ^pname while existf `node_data/proc_dir/^pname do if /bin/ps -axN | /com/fpat "%^pname" | read foo then pname := "^oldname.^cnt" cnt := ^cnt + 1 else dlf -du -f `node_data/proc_dir/^pname endif enddo /com/ctob `node_data/proc_dir/^pname ^hi ^lo enddo -- Alphalpha Software, Inc. | motif-request@alphalpha.com nazgul@alphalpha.com |----------------------------------- 617/646-7703 (voice/fax) | Proline BBS: 617/641-3722 I'm not sure which upsets me more; that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's.