does LD_PRELOAD work under cygwin?

basic basic@mozdev.org
Fri Dec 4 05:04:00 GMT 2009


Hi,
  Does LD_PRELOAD work under cygwin? I've tried the following without success:

gcc test.c
gcc -shared testlib.c -o testlib.dll

LD_PRELOAD=$HOME/testlib.dll ./a.exe

where test.c is:

#include <fcntl.h>

int main()
{
    open("", 1);
    return 0;
}


and testlib.c is:

#include <stdio.h>

int open(const char *s, int i, ...)
{
    puts("test");
    return 0;
}

Is there anything I'm doing wrong? Or is it just not supported?

--
basic



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list