🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #5607

Process Startup... from WB or another process?

#5607
From: Terry Cudney
Date: Thu, 04 Oct 1990 03:47
39 lines
1662 bytes
Hi all,

     Is there an officially accepted way for a process to determine how
it was started?

     It's easy to tell if it started from WB or CLI. But how does it know
if it was started from another Process (which PutMsg'ed a WBStartup to get
it going)?

     I have a suite of programs that can be individually launched from CLI
or WB, or from a master control program which orchestrates the whole suite.
In each slave program I check pr -> CLI to see if it was launched from CLI,
If not I assume it was launched from either WB or the master program. Here
is my question:

     How should the new process determine if it was started from WB or
from another application process?

     In the master program all ports are created without names so that multiple
master programs/suites can be run concurrently without name collisions.
What I've been doing is:

strcmp(WBStartup.sm_Message.mn_ReplyPort -> mp_Node.ln_Name, "Workbench")

     If a match, assume WB launched us, otherwise assume the master program
launched us. Is this safe? Or is there a better way?
Thanks for any help you can give.
--terry

/*
 * terry@chaplin.csd.uwo.ca
 * Terry Cudney Amistosa MicroWare 9 Durham Street, LONDON, Ontario, N5Y 2H9
 */

--
--terry

/*
 * terry@chaplin.csd.uwo.ca
Technical Details
Message-ID: <1083@ria.ccs.uwo.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!ria!chaplin!terry

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!ria!chaplin!terry
From: terry@chaplin.uwo.ca (Terry Cudney)
Newsgroups: comp.sys.amiga.tech
Subject: Process Startup... from WB or another process?
Keywords: WorkBench Startup Processes
Message-ID: <1083@ria.ccs.uwo.ca>
Date: 4 Oct 90 03:47:14 GMT
Sender: news@ria.ccs.uwo.ca
Organization: Amistosa MicroWare
Lines: 39