home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!decwrl!netcomsv!terapin!paulk
- From: paulk@terapin.com (Paul Kienitz)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: HELP! Detach with OS2.0+
- References: <1993Jan20.171355@informatik.uni-kl.de>
- Message-ID: <paulk.3evv@terapin.com>
- Date: 23 Jan 93 10:20:32 PST
- Organization: BBS
- Lines: 23
-
- > I've run into a problem using 2.0 dos function SystemTags. I want
- > to detach from the calling console, create a new process with a
- > user specifiable (sp?) console (e.g. ../AUTO) etc.
- >
- > Especially, I want to use the SYS_Entry tag, because the new task
- > should'nt run the same code again.
-
- There's no reason why you couldn't run the same code again. Test a
- global variable for nonzero -- if it's zero then this is the first
- non-detached run, so set it nonzero. That's how 1.x detach code
- using CreateProc works. But with your method you can make the
- detached process a CLI, which the old method can't do.
-
- > BUT: How must I arrange the startup-code, so that it frees the
- > segment when the program exits?
- >
- > I think of using the SYS_EntryCode/Data tags, but how could I free
- > the Segment without exiting the process first?
-
- The way it's traditionally done is to create a struct MemEntry
- attached to the tc_MemEntry list of your struct Task, so the seglist
- is automatically deallocated at RemTask time. The MemEntry needs one
- pointer for each hunk of the seglist.
-