delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/12/04/03:57:49

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <4B18CEF9.4040309@mozdev.org>
Date: Fri, 04 Dec 2009 16:57:29 +0800
From: basic <basic AT mozdev DOT org>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4pre) Gecko/20090928 Thunderbird/3.0b4
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: R: does LD_PRELOAD work under cygwin?
References: <991032 DOT 65593 DOT qm AT web25505 DOT mail DOT ukl DOT yahoo DOT com>
In-Reply-To: <991032.65593.qm@web25505.mail.ukl.yahoo.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 12/04/2009 03:05 PM, Marco Atzeri wrote:
> --- Ven 4/12/09, basic  ha scritto:
>
>> Hi,
>>   Does LD_PRELOAD work under cygwin? I've tried the
>> following without success:
>
> LDPRELOAD works with few peculiarites for multiple dll's
> but this is not your case.
>
>>
>> gcc test.c
>> gcc -shared testlib.c -o testlib.dll
>
> see documentation
> http://cygwin.com/cygwin-ug-net/dll.html
> on how to build and link dll's
I've read the document, but I do not see what I'm doing is any different from it. Any hints?

>
>>
>> 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
>>
> regards
> Marco
>
>
>
>


--
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

- Raw text -


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