[comp.sys.apollo] How do you give a fork

dente@els.ee.man.ac.uk (Colin Dente) (09/21/90)

I have a program, running under SR9.7 (I know, I know, but it's a 330 sat
at home, and boy, does the electricity company love me!).  Said program
does a fork() at startup, and then the parent does the honourable thing
(i.e. exits), all because I'm too lazy to stick an '&' at the end of the
command line! ;-)

The problem is, when I do a pst, the child process shows up with just its
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?).

Cheers

Colin

--
  Colin Dente                     | JANET: dente@uk.ac.man.ee.els
  Manchester Computing Centre     | ARPA:  dente@els.ee.man.ac.uk 
  University of Manchester, UK    | UUCP:  ...!ukc!man.ee.els!dente 
                 ... I am the one you warned me of ...

nazgul@alphalpha.com (Kee Hinckley) (09/24/90)

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.