gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Gnu-arch-users] Arch On Cygwin(Win32)


From: Robert Collins
Subject: RE: [Gnu-arch-users] Arch On Cygwin(Win32)
Date: Thu, 27 Nov 2003 23:54:50 +1100

On Thu, 2003-11-27 at 21:50, address@hidden wrote:
> In hackerlab, vu_open() returns a file descriptor. We need a version of
> open() that supports long pathnames, but it appears there isn't one in
> win32.

Yep.

> So I've updated vu_open() to call CreateFileW() instead. However, this
> returns a handle, which can be converted into a file descriptor using
> _open_osfhandle().
> 
> _open_osfhandle() is in the VC++ RTL. From my (somewhat naive)
> experiments, and searching through the Cygwin mailing list archives, it
> appears that we can't link both libmsvcrt.a and cygwin.dll. I can build
> some test code that successfully returns a working file descriptor by
> compiling with -lmsvcrt and -mno-cygwin.

Right. Cygwin /is/ a libc - just as libmsvcrt is. Use one or the other.
Cygwin has it's own handle->filedescriptor mapping, performed
internally. (Also, it does 64-bit file IO, which IIRC libmsvcrt
doesn't).

> Have you had to tackle a similar problem in Cygwin itself, or is there
> some problem with my understanding of the issue?

We tackled those problems oh, 10 years back. Keep it up, you've only a
man-year or two to go.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]