Subject: libc and building cygwin32.dll
From: [email-masked] (Benoit Papillault)

1 Jun 1998 08:13:15 -0700
Message-ID: <Pine.GSO.3.96.980601013846.2916D-100000.cygnus.gnu-win32@parakeet>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
To: [email-masked]

Hello,

I am trying to write a tiny telnet daemon. It's rather simple under Unix
even if you have to learn how to create a master tty device. I have tried
to recompiled my unix source code under Windows 95 using cygwin32b19. In
this case, I have used bash as shell. The redirections works! I mean,
everything sent by bash is received by the telnet client and vice-versa. 
However, it works in line discipline mode (as we said in the unix world!)
and bash doesn't seems to understand my commands (he just say: error 22).
With command.com, it's worse, it's like there is no redirections at all.

So, I have thought that this too simple code will never compiled. I have
already programmed under Windows (both NT3.51, NT4.0, 95, 3.1). I have
even made a tool (nslookup like) that works both under 96,NT and Unix.
So, I have tried to rewritte my code from scratch. For sockets, I use
Winsocks, I can use select() and ioctlsocket(FIONBIO) to get data as soon
as they are received. So, for the networks part, it works. 

Now for the redirection part. I have searched the Micro$oft web server and
found many documentations. I have tried the sample using SetStdHandle,
GetStdHandle, DuplicateHandle, CreatePipe and CreateProcess. It use two
anonymous pipe to make the redirection. ok. But you can't read and write
on both pipes at the same time. The overlapped operations are not
supported. Named pipes are not supported under Windows 95. And finally,
thread seams incompatible with cygwin32 (yeah, I have tried to weird thing
which consists to create two threads, one for each direction! although
it's pretty simple to read on many file descriptors at the same under
unix).

So, I have thought to another solutions: not using cygwin32.dll but just
Win32 API. Not tested yet. But for further development, It could be
interested to have a libc WITHOUT all the unix enulation made by
cygwin32.dll. I have a look at mingwin32 (which uses CRTDLL from
Micro$oft, Am I right?).

Here is the question: Is there a libc (source code form obviously) 
available under Win32? 

Just to do my printf() and malloc() as usual. If nothing available, I am
ready to write one (but a smal one, just with all the fprintf(), fopen(),
.... , malloc(), free(), strdup() functions. But I prefer to ask before
wasting my time.

		Benoit Papillault

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".