qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
	QEMU Developer <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] trace/simple: Fix warning and wrong trace file name for MinGW
Date: Mon, 28 Sep 2015 17:19:02 +0200	[thread overview]
Message-ID: <56095A66.8050003@weilnetz.de> (raw)
In-Reply-To: <5609576F.2060407@redhat.com>

Am 28.09.2015 um 17:06 schrieb Eric Blake:
> On 09/28/2015 02:26 AM, Stefan Weil wrote:
>
>>> Can you explain why osdep.h's
>>>
>>>     #define FMT_pid "%" PRId64
>>>
>>> is appropriate for Windows?
>> Don't blame me for any strangeness which you might find in Windows. :-)
>>
>> Mingw-w64 sys/types.h defines pid_t to be either an int or an __int64.
>> FMT_pid must match these definitions.
>>
>> But getpid returns an int, not a pid_t...
> Can we 1) file a bug against mingw for their buggy getpid(), and 2)
> write a wrapper that makes getpid() always return pid_t in the meantime?

1) No, because MinGW and Mingw-w64 use the same declaration as MS.
They cannot change that, of course. Nor will MS correct this after many
years, for obvious reasons.

2) We could use a wrapper qemu_getpid or #define getpid() ((pid_t)getpid()).
But that would require several other code changes.

  reply	other threads:[~2015-09-28 15:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 20:12 [Qemu-devel] [PATCH] trace/simple: Fix warning and wrong trace file name for MinGW Stefan Weil
2015-09-28  7:00 ` Markus Armbruster
2015-09-28  8:26   ` Stefan Weil
2015-09-28 15:06     ` Eric Blake
2015-09-28 15:19       ` Stefan Weil [this message]
2015-09-28 15:50         ` Eric Blake
2015-09-28 19:55           ` Stefan Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56095A66.8050003@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).