Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130314181759.GC19010@port70.net>
Date: Thu, 14 Mar 2013 19:17:59 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: question: hard-coded file descriptors in
 stdin/stdout/stderr

* Zvi Gilboa <zg7s@...rvices.virginia.edu> [2013-03-14 13:51:19 -0400]:
> ... since you are asking...  inspired by musl-libc, I am currently
> writing a win32/win64 open-source library that implements/provides
> POSIX system calls (see note below).  I believe that having a
> powerful libc with an MIT license available on Windows would
> actually be of great value to the open source community for all

ok

> The main issue here is that the standard file descriptors on Windows
> are -10 (STD_INPUT_HANDLE), -11 (STD_OUTPUT_HANDLE), and -12

ouch

i think windows file handles have very
different semantics than posix fds
(dup2, fork,..)

so you need to do hacks if you want posix
on windows

> * as for psxcalls: this is a C library, that exclusively uses the
> Native API.  It attaches to ntdll.dll during run-time, and can thus
> be compiled as a "native" static library with no external
> dependencies.  While it is currently in its very initial stage (and
> not yet online), the major "obstacle" features -- including fork()
> -- have already been implemented.  To remove all doubts, I am aware
> of Cygwin's existence, yet am looking for a high-performance
> solution that would be both "clean"
> (psxcalls-->libc-->user-library-or-application), and flexibly
> licensed.

how do you implement fork?

(windows version of some tools actually allow redirecting
io of child processes i wonder how your fork would interact
with that, eg gawk can read/write to "/dev/fd/n" so what
would happen if you fork such a child, can you communicate
with it with pipes?)

(at some point there was discussion about porting musl to
various systems including windows and the conclusion was
that it should be done on the syscall layer and fork would
be ugly and slow no matter what you do)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.