cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/09/11:16:53

From: "Luke Bishop" <lbishop AT calvin DOT stemnet DOT nf DOT ca>
Newsgroups: comp.lang.c,comp.os.msdos.djgpp
Subject: Re: Executing a program and obtaining its return value
Date: 9 Apr 1998 02:45:14 GMT
Organization: The Zone
Lines: 18
Message-ID: <01bd6299$58f966a0$3448a5c6@technoid>
References: <352C1A0D DOT 77EAB402 AT codex DOT nu>
NNTP-Posting-Host: n072h052.thezone.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> Also, do you suppose it's portable to return pointers from executables? 
> It seems to me that any system would be able to return a pointer pretty
> easily, considering pointers are almost always size_of(int) and int
> seems to be returned all the time.  I'm just wondering if there are any
> odd problems I should know about.

Yes, lots of odd problems.  
	Number 1: The memory has been freed, so if you try to use the pointer,
you'll get a SEGV.  
	Number 2: The memory does not belong to the first program anyway even if
it wasnt freed.  See #1 for results.
	Number 3: Selector may be different.  Even excluding #1 & 2, this would
cause you to lose the exact memory.

	What exactly are you trying to use it for?  It almost sounds like a case
where a dynamic linker (like DLX (c) me) would be more useful than just
executable files with strange pointer layout.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019