Could we add a preprocessor configuration option like
__USE_MINGW_POSIX_PID which makes getpid() actually return a pid_t
(signed 64-bit integer)?  (It can be wrapped in a function named
__mingw_getpid or something.)  So POSIXY projects could opt in to the
new behavior in their build configuration, and Windowsy projects would
keep working as is?  It would be like __USE_MINGW_ANSI_STDIO.

--David

On Tue, Mar 1, 2016 at 11:08 AM, Eric Blake <ebl...@redhat.com> wrote:
> On 03/01/2016 11:54 AM, Stefan Weil wrote:
>
>> Kai is absolutely right regarding the signedness. I suggest replacing
>> "int" by "unsigned" or "unsigned int" in my patch as DWORD and
>> unsigned int have the same size for Windows. Feel free to do so
>> before committing it (otherwise I'd have to resend it). It's a pity
>> that getpid() still has to return an int (because of compatibility
>> with the MS getpid()) instead of the normal pid_t.
>
> NACK.  POSIX requires pid_t to be signed.
>
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html#tag_13_67
>
> blksize_t, pid_t, and ssize_t shall be signed integer types.
>
>
>>
>> A short look at the Mingw-w64 code shows several type casts from
>> pid_t to DWORD. This code will continue to work with my patch,
>> but the type casts are no longer needed.
>>
>> Regards,
>> Stefan
>>
>
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to