From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2914 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: question: hard-coded file descriptors in stdin/stdout/stderr Date: Thu, 14 Mar 2013 19:17:59 +0100 Message-ID: <20130314181759.GC19010@port70.net> References: <5141F86D.8010000@eservices.virginia.edu> <20130314171752.GB19010@port70.net> <51420E17.9030305@eservices.virginia.edu> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1363285090 19777 80.91.229.3 (14 Mar 2013 18:18:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Mar 2013 18:18:10 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2915-gllmg-musl=m.gmane.org@lists.openwall.com Thu Mar 14 19:18:36 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UGCja-0003UF-GT for gllmg-musl@plane.gmane.org; Thu, 14 Mar 2013 19:18:34 +0100 Original-Received: (qmail 27650 invoked by uid 550); 14 Mar 2013 18:18:11 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 26618 invoked from network); 14 Mar 2013 18:18:11 -0000 Content-Disposition: inline In-Reply-To: <51420E17.9030305@eservices.virginia.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2914 Archived-At: * Zvi Gilboa [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)