From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: pipe Date: Sat, 14 Mar 2015 10:54:54 +0200 Message-ID: <83d24c2c2p.fsf@gnu.org> References: <83twxp2mew.fsf@gnu.org> <87h9tp3wsp.fsf-ueno@gnu.org> <87wq2kd5je.fsf@vigenere.g10code.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1426323323 29942 80.91.229.3 (14 Mar 2015 08:55:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Mar 2015 08:55:23 +0000 (UTC) Cc: ueno@gnu.org, emacs-devel@gnu.org To: Werner Koch Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 14 09:55:14 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YWhqk-0003uS-8p for ged-emacs-devel@m.gmane.org; Sat, 14 Mar 2015 09:55:14 +0100 Original-Received: from localhost ([::1]:40057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWhqj-0006ql-HG for ged-emacs-devel@m.gmane.org; Sat, 14 Mar 2015 04:55:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWhqX-0006qg-H3 for emacs-devel@gnu.org; Sat, 14 Mar 2015 04:55:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWhqS-00017S-I5 for emacs-devel@gnu.org; Sat, 14 Mar 2015 04:55:01 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:53793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWhqS-00017G-9r; Sat, 14 Mar 2015 04:54:56 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NL700D001OTFN00@mtaout24.012.net.il>; Sat, 14 Mar 2015 10:47:06 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NL7007181QISP50@mtaout24.012.net.il>; Sat, 14 Mar 2015 10:47:06 +0200 (IST) In-reply-to: <87wq2kd5je.fsf@vigenere.g10code.de> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.180 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183866 Archived-At: > From: Werner Koch > Date: Fri, 13 Mar 2015 21:08:21 +0100 > Cc: Eli Zaretskii , emacs-devel@gnu.org > > On Fri, 13 Mar 2015 13:29, ueno@gnu.org said: > > >> Can these features of gpg be used on MS-Windows? IOW, how do you > >> invoke a subprocess with redirected file descriptors beyond the 3 > >> standard ones, in a way that will work not only on Posix platforms > >> that support the full 'fork' functionality? > > > > Actually, I'm not sure, but there was a porting effort of the GPG stack > > to Windows and Windows CE, and I think there should be a way to work > > GnuPG-2 runs very well on Windows for about 10 years. Windows has pipes > but inheriting only specific handles (OS file descriptors) is a bit > complicated and requires the use of a wrapper process (gpgme-w32spawn, > Glib uses something similar). Thanks, but where do I see the source of that wrapper? I tried the gpg Git repo, but I don't think I see it there. Did I miss something? And anyway, how does this wrapper solve the problem of invoking gpg with the --status-fd, --command-fd, and --attribute-fd options? IOW, how can the invoking program pass file descriptors on the gpg command line, and be sure gpg will use the same files/devices as the caller? You say: > The old WindowsCE has only per-process file descriptors. Thus I had to > write a device driver to implement OS wide file descriptors. I'm guessing you actually mean "file handles", not "file descriptors" here. The latter are small integer numbers, like 0 for standard input, 1 for standard output, etc. -- these are per-process on any version of Windows, AFAIK. So I'm unsure how can a file descriptor like 6 be passed to gpg -- AFAIK it will end up connected to nothing on the child side. (There's an undocumented trick in the MSVC runtime that allows this to work, but AFAIK that doesn't work with MinGW, only with the Microsoft compilers.)