home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / amiga / programm / 19110 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  1.4 KB

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