Date: Mon, 9 Jun 1997 13:50:05 +0300 (IDT) From: Eli Zaretskii To: Michael Goffioul cc: djgpp AT delorie DOT com Subject: Re: Sharing global variable In-Reply-To: <339BB7B0.2EAD@emic.ucl.ac.be> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Mon, 9 Jun 1997, Michael Goffioul wrote: > For example, if a static variable "a" is declared in a header file > included in 2 differents programs "prog1.exe" and "prog2.exe". If > "prog1.exe" calls "prog2.exe", is it possible that prog2 uses the same > global variable than prog1 ? It's possible, but highly non-portable. Since most DPMI servers implement DPMI 0.9, all the selectors are global. This means that a parent program can advertise its DS selector and the address (offset) of any variable to its children programs (e.g., via the command line used to invoke the child program) and the child programs can access those variables using `farptr' functions.