From: Alex Riesen Date: Mon, 14 Sep 2009 14:18:23 GMT Subject: Re: [PATCH 14/17] Add ftruncate implementation for MSVC Message-ID: <81b0412b0909140718i7d2c4e3cpc96477f8374d80b4@mail.gmail.com> In-Reply-To: On Mon, Sep 14, 2009 at 15:11, Marius Storm-Olsen wrote: > +int ftruncate(int fd, __int64 length) > +{ > +       HANDLE fh = (HANDLE)_get_osfhandle(fd); > +       if (!fh || _lseeki64(fd, length, SEEK_SET)) According to MSDN, error is manifested by returning INVALID_HANDLE_VALUE (–1): http://msdn.microsoft.com/en-us/library/ks2530z6.aspx