Article View: comp.sys.amiga.tech
Article #5815Process Startup... from WB or another process? (REPOST)
From: Terry Cudney
Date: Sat, 13 Oct 1990 18:36
Date: Sat, 13 Oct 1990 18:36
39 lines
1713 bytes
1713 bytes
Hi all,
Is there an officially sanctioned 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)? How should the new process determine if it was started from WB
or from another application process?
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.
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:
if (strcmp(WBStartup.sm_Message.mn_ReplyPort -> mp_Node.ln_Name,
"Workbench") == 0)
/* launched by WB */
else
/* launced by control process */
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:
<1158@ria.ccs.uwo.ca>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!watserv1!ria!chaplin!terryShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!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? (REPOST) Keywords: WorkBench Startup Processes Message-ID: <1158@ria.ccs.uwo.ca> Date: 13 Oct 90 18:36:19 GMT Sender: news@ria.ccs.uwo.ca Followup-To: comp.sys.amiga.tech Organization: Amistosa MicroWare Lines: 39