From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25268 invoked by alias); 1 May 2005 03:46:26 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25258 invoked from network); 1 May 2005 03:46:21 -0000 Received: from unknown (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org with SMTP; 1 May 2005 03:46:21 -0000 Received: from zaretski (IGLD-80-230-65-115.inter.net.il [80.230.65.115]) by romy.inter.net.il (MOS 3.5.6-GR) with ESMTP id BCN25184 (AUTH halo1); Sun, 1 May 2005 06:44:24 +0300 (IDT) Date: Sun, 01 May 2005 03:46:00 -0000 From: "Eli Zaretskii" To: Paul Brook Message-ID: <01c54dff$Blat.v2.4$ea33f500@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 CC: gdb-patches@sources.redhat.com In-reply-to: <200504291539.15275.paul@codesourcery.com> (message from Paul Brook on Fri, 29 Apr 2005 15:39:15 +0100) Subject: Re: [patch] Building simulators on windows hosts Reply-to: Eli Zaretskii References: <200504291539.15275.paul@codesourcery.com> X-SW-Source: 2005-05/txt/msg00001.txt.bz2 > From: Paul Brook > Date: Fri, 29 Apr 2005 15:39:15 +0100 > > +#ifdef HAVE_LSTAT > return wrap (p, lstat (file, buf)); > +#else > + return wrap (p, stat (file, buf)); > +#endif Wouldn't it be cleaner to say in some strategic place (like a header included by many sim files) #ifndef HAVE_LSTAT #define lstat stat #endif and then leave the *.c files alone? I think this is a better solution, and include/gdb/callback.h seems like a good place to do that. Perhaps it's even something MinGW headers should do for you, but for now a GDB solution will be fine. > +#ifdef HAVE_FTRUNCATE > result = wrap (p, ftruncate (fdmap (p, fd), len)); > +#else > + p->last_errno = EINVAL; > + result = -1; > +#endif > return result; `ftruncate' is a very simple function; you could write an emulation using `lseek' and `write'. (If you want, I can show you the implementation from the DJGPP library.) I think it's better to add such an emulation that to fail the calls.