This is the mail archive of the
cygwin-talk
mailing list for the cygwin project.
Re: Design mixed 32 and 64 bit systems.
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: The Vulgar and Unprofessional Cygwin-Talk List <cygwin-talk at cygwin dot com>
- Date: Mon, 2 Dec 2013 16:05:51 -0500
- Subject: Re: Design mixed 32 and 64 bit systems.
- Authentication-results: sourceware.org; auth=none
- References: <6CF2FC1279D0844C9357664DC5A08BA21D7054 at MLBXV06 dot nih dot gov> <529CE0E4 dot 4080804 at etr-usa dot com> <20131202195626 dot GC604 at ednor dot casa dot cgf dot cx> <529CEDE5 dot 4030703 at etr-usa dot com>
- Reply-to: The Vulgar and Unprofessional Cygwin-Talk List <cygwin-talk at cygwin dot com>
- Reply-to: cygwin-talk at cygwin dot com
On Mon, Dec 02, 2013 at 01:30:29PM -0700, Warren Young wrote:
>On 12/2/2013 12:56, Christopher Faylor wrote:
>> On Mon, Dec 02, 2013 at 12:35:00PM -0700, Warren Young wrote:
>>> This happens because POSIX PIDs are in a table that lives in
>>> cygwin1.dll's memory space, and because there are two DLLs, there are
>>> two different PID tables.
>>
>> Actually POSIX pids are Windows PIDs. The distinction becomes fuzzy
>> after an exec, though, where the Cygwin PID continues to be the PID
>> of the process which previously exec'ed it.
>
>Of the four PID values this pair of programs prints, shouldn't at least
>two should be the same, then? I get four different values here:
>
>PARENT: My PID is 5048; created child PID 5684
>CHILD: My PID is 3108; my parent's PID is 1.
The parent pid *is* a cygwin invention (although technically it doesn't
have to be). When executed between different architectures you lose the
parent/child linkage, since as you say, the DLL in the execed process
thinks it's being started from a non-cygwin windows program.
It's a subtle distinction but there is no real table of Cygwin pids
maintained by the DLL. Each process has a shared memory region
associated with it that holds information like the parent pid. This
shared memory region is not recognized between x86/x86_64.
cgf