X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=UhEcDeruxs4L72EdMf2T9OZP7+dxt8Xlulo28PQhKq1 a71EaNDOOwbY1+qb620v2cMOvoPhK+rTE3SadXXoK2f7H0vpP6jZ/b7Np6EJPw3A Ai6tgfnrbEFgU0DiYiL54ultg9dtaHlLLgfWkLL3X9dCuuwbG3HOkes/o8F/rJYQ = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=MT1yCe6+4WcM13ikQFrJNRugdmw=; b=OxW1IFD1zcNhJpHvI FlXTxY8HdE/s91jSVKpoVb5mz/1ROYwf3KnrUDxdrsM/QXshvil4qaEKF+RSJjYm rL0BkT49ZzSbGHdgCz0DnuxdNmo+7/j9os0v6ACPyDB+kqGdQeCs0B+1Wf5LIUyE gJ7bKQGrEIPr2sepVFftTJNIwA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pb0-f52.google.com X-Received: by 10.66.121.131 with SMTP id lk3mr19229369pab.61.1382857477739; Sun, 27 Oct 2013 00:04:37 -0700 (PDT) Message-ID: <526CBB01.60407@users.sourceforge.net> Date: Sun, 27 Oct 2013 02:04:33 -0500 From: "Yaakov (Cygwin/X)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Hooks do not work? References: <81f61e1925b5d6639ac9ba6a64b80ae7 AT autistici DOT org> In-Reply-To: <81f61e1925b5d6639ac9ba6a64b80ae7@autistici.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2013-10-26 01:32, niXman wrote: > I try to create the hooks for open()/fopen(). > > hook code: > #include #ifdef __CYGWIN__ #include #endif > int open(const char *fname, int mode, ...) { > printf("fname=%s\n", fname); > } > > FILE* fopen(const char *fname, const char *mode) { > printf("fname=%s\n", fname); > } #ifdef __CYGWIN__ __attribute__((constructor)) void _init(void) { cygwin_internal(CW_HOOK, "open", open); cygwin_internal(CW_HOOK, "fopen", fopen); } #endif HTH, Yaakov -- 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