diff mbox

Fix build on FreeBSD

Message ID 4DE501D2.7060505@freebsd.org
State New
Headers show

Commit Message

Nathan Whitehorn May 31, 2011, 2:57 p.m. UTC
Add some includes required to build qemu on FreeBSD.

---
  bsd-user/syscall.c |    2 ++
  iohandler.c        |    1 +
  os-posix.c         |    4 ++++
  3 files changed, 7 insertions(+), 0 deletions(-)

Comments

Andreas Färber June 2, 2011, 3:01 p.m. UTC | #1
Am 31.05.2011 um 16:57 schrieb Nathan Whitehorn:

> Add some includes required to build qemu on FreeBSD.

Missing Sob.

> ---
> bsd-user/syscall.c |    2 ++
> iohandler.c        |    1 +
> os-posix.c         |    4 ++++
> 3 files changed, 7 insertions(+), 0 deletions(-)
[...]
> diff --git a/iohandler.c b/iohandler.c
> index 2b82421..7266aca 100644
> --- a/iohandler.c
> +++ b/iohandler.c
> @@ -29,6 +29,7 @@
>
> #ifndef _WIN32
> #include <sys/wait.h>
> +#include <signal.h>
> #endif
>
> typedef struct IOHandlerRecord {

This is independent of the other BSD issues (that I cannot judge) and  
affects Darwin and Haiku as well. Did you check that with your patch  
Win32 does not need the header?

Alexandre (cc'ed) posted a slightly different patch, adding it in qemu- 
common.h instead.

Andreas
Nathan Whitehorn June 5, 2011, 2:03 p.m. UTC | #2
On 06/02/11 10:01, Andreas Färber wrote:
> Am 31.05.2011 um 16:57 schrieb Nathan Whitehorn:
>
>> Add some includes required to build qemu on FreeBSD.
>
> Missing Sob.

Oops, I'll resubmit.

>> ---
>> bsd-user/syscall.c |    2 ++
>> iohandler.c        |    1 +
>> os-posix.c         |    4 ++++
>> 3 files changed, 7 insertions(+), 0 deletions(-)
> [...]
>> diff --git a/iohandler.c b/iohandler.c
>> index 2b82421..7266aca 100644
>> --- a/iohandler.c
>> +++ b/iohandler.c
>> @@ -29,6 +29,7 @@
>>
>> #ifndef _WIN32
>> #include <sys/wait.h>
>> +#include <signal.h>
>> #endif
>>
>> typedef struct IOHandlerRecord {
>
> This is independent of the other BSD issues (that I cannot judge) and 
> affects Darwin and Haiku as well. Did you check that with your patch 
> Win32 does not need the header?
>
> Alexandre (cc'ed) posted a slightly different patch, adding it in 
> qemu-common.h instead.

Ah, that's fine then. I have no idea about Win32, I just know it won't 
compile on FreeBSD without it, since it hasn't been included yet as a 
side effect.
-Nathan
Alexandre Raymond June 7, 2011, 3:27 p.m. UTC | #3
Hi Nathan,

On Sun, Jun 5, 2011 at 10:03 AM, Nathan Whitehorn
<nwhitehorn@freebsd.org> wrote:
> On 06/02/11 10:01, Andreas Färber wrote:
>>
>> Am 31.05.2011 um 16:57 schrieb Nathan Whitehorn:
>>
>>> Add some includes required to build qemu on FreeBSD.
>>
>> Missing Sob.
>
> Oops, I'll resubmit.
>
>>> ---
>>> bsd-user/syscall.c |    2 ++
>>> iohandler.c        |    1 +
>>> os-posix.c         |    4 ++++
>>> 3 files changed, 7 insertions(+), 0 deletions(-)
>>
>> [...]
>>>
>>> diff --git a/iohandler.c b/iohandler.c
>>> index 2b82421..7266aca 100644
>>> --- a/iohandler.c
>>> +++ b/iohandler.c
>>> @@ -29,6 +29,7 @@
>>>
>>> #ifndef _WIN32
>>> #include <sys/wait.h>
>>> +#include <signal.h>
>>> #endif
>>>
>>> typedef struct IOHandlerRecord {
>>
>> This is independent of the other BSD issues (that I cannot judge) and
>> affects Darwin and Haiku as well. Did you check that with your patch Win32
>> does not need the header?
>>
>> Alexandre (cc'ed) posted a slightly different patch, adding it in
>> qemu-common.h instead.
Normally, the following patch should solve this particular missing
header. It's already been added to the trivial patches queue by
Stefan.
http://patchwork.ozlabs.org/patch/98325/

Alexandre
diff mbox

Patch

diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
index eb1cdf2..7b49f54 100644
--- a/bsd-user/syscall.c
+++ b/bsd-user/syscall.c
@@ -212,9 +212,11 @@  static int sysctl_oldcvt(void *holdp, size_t 
holdlen, uint3
2_t kind)
          *(uint64_t *)holdp = tswap64(*(unsigned long *)holdp);
          break;
  #endif
+#ifdef CTLTYPE_QUAD
      case CTLTYPE_QUAD:
          *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp);
          break;
+#endif
      case CTLTYPE_STRING:
          break;
      default:
diff --git a/iohandler.c b/iohandler.c
index 2b82421..7266aca 100644
--- a/iohandler.c
+++ b/iohandler.c
@@ -29,6 +29,7 @@ 

  #ifndef _WIN32
  #include <sys/wait.h>
+#include <signal.h>
  #endif

  typedef struct IOHandlerRecord {
diff --git a/os-posix.c b/os-posix.c
index 3204197..13b7229 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -44,6 +44,10 @@ 
  #include <sys/syscall.h>
  #endif

+#ifdef CONFIG_BSD
+#include <sys/sysctl.h>
+#endif
+
  #ifdef CONFIG_EVENTFD
  #include <sys/eventfd.h>
  #endif