Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site cyb-eng.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!ut-sally!oakhill!cyb-eng!bc From: bc@cyb-eng.UUCP (Bill Crews) Newsgroups: net.micro Subject: Re: Help with MS-DOS Message-ID: <540@cyb-eng.UUCP> Date: Tue, 23-Apr-85 09:16:51 EST Article-I.D.: cyb-eng.540 Posted: Tue Apr 23 09:16:51 1985 Date-Received: Fri, 26-Apr-85 21:47:58 EST References: <10051@brl-tgr.ARPA> <1700@watcgl.UUCP> Organization: Cyb Systems, Austin, TX Lines: 29 The deal is that you are working with the child process's environment, which was set up as a copy of the parent's environment when the child was forked. There are probably several ways to solve your problem; what comes to mind is that two undocumented DOS function calls (things you get at with int 21h) not only get the segment address of the current psp (program segment prefix) but can also *set* (think on this!) a psp as being the current psp . . . like, multitasking, huh? These are functions 51h and 50h respectively. You could get the current psp and save it, set your parent's psp as current (communicating your parent's psp to the child is comething you must take care of some way or another) and then access the environment. You will be accessing the parent environment. Be aware, however, that you have actually set the parent to be the current process, so any files you might open will belong to the parent, *not* the child! So be careful to set the psp back to the child before continuing. There may be an easier way, but I can't think of it offhand. By the way, I don't warrant the use of functions 50h and 51h -- I just use them and they seem to work. Good luck. -- / \ Bill Crews ( bc ) Cyb Systems, Inc \__/ Austin, Texas [ gatech | ihnp4 | nbires | seismo | ucb-vax ] ! ut-sally ! cyb-eng ! bc