emacs-devel
[Top][All Lists]
Advanced

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

Re: pipe


From: Eli Zaretskii
Subject: Re: pipe
Date: Sat, 14 Mar 2015 10:54:54 +0200

> From: Werner Koch <address@hidden>
> Date: Fri, 13 Mar 2015 21:08:21 +0100
> Cc: Eli Zaretskii <address@hidden>, address@hidden
> 
> On Fri, 13 Mar 2015 13:29, address@hidden 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.)



reply via email to

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