public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* dlopen a.exe
@ 2000-05-31  3:32 Jon Cook
  2000-05-31  6:34 ` Chris Faylor
  0 siblings, 1 reply; 5+ messages in thread
From: Jon Cook @ 2000-05-31  3:32 UTC (permalink / raw)
  To: cygwin

Hi,

Can you use dlopen with the pathname set to 0 to open a.exe?
When I tried doing this with the code below, dlsym failed with "Win32
Error 127".

Thanks for any help,
Jon



#include <dlfcn.h>

float fn(float num)
{
  return num*5.0;
}

int main(void)
{
  void *hnd, *fnaddr;

  hnd= dlopen(0, RTLD_NOW);

  if (!hnd) {
    printf("Failed at dlopen - %s\n", dlerror());
    exit(1);
  }

  fnaddr= dlsym(hnd, "fn");

  if (!fnaddr) {
    printf("Failed at dlsym - %s\n", dlerror());
    exit(1);
  }
  
  printf("OK [%x]\n", fnaddr);
}

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-08-07  8:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E13Ldqn-0008PJ-00@nestle.ai.mit.edu>
2000-08-06 21:02 ` dlopen a.exe Chris Faylor
2000-08-06 22:58   ` Brian D. Carlstrom
2000-08-07  8:31     ` Jon Cook
2000-05-31  3:32 Jon Cook
2000-05-31  6:34 ` Chris Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).