Skip to contentSkip to conversation

Fix ioemu compile on Solaris

PATCH In review [email protected] 3 participants 3 messages Feb 22, 2008 – Feb 25, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix ioemu compile on Solaris

# HG changeset patch
# User [email protected]
# Date 1203680243 28800
# Node ID 3a0e7fc8b4b7c650c9377c7b2a197c127913a622 # Parent 0accc274f62715d356a591d2286027f7591a9412 Fix ioemu compile on Solaris

_POSIX_C_SOURCE does not guarantee the available of the 1003.1j option which contains posix_memalign(). Fix the test to explicitly test for Linux.

tools/ioemu/osdep.c +1 -1
@@ -178,7 +178,7 @@ void kqemu_vfree(void *ptr)
 
 void *qemu_memalign(size_t alignment, size_t size)
 {
-#if defined(_POSIX_C_SOURCE)
+#if defined(__Linux__)
     int ret;
     void *ptr;
     ret = posix_memalign(&ptr, alignment, size);
#1 lore raw
Quoted 17 lines · On Friday 22 February 2008 14:05:00 [email protected] wrote:

# HG changeset patch
# User [email protected]
# Date 1203680243 28800
# Node ID 3a0e7fc8b4b7c650c9377c7b2a197c127913a622 # Parent 0accc274f62715d356a591d2286027f7591a9412 Fix ioemu compile on Solaris

_POSIX_C_SOURCE does not guarantee the available of the 1003.1j option which contains posix_memalign(). Fix the test to explicitly test for Linux.

tools/ioemu/osdep.c void kqemu_vfree(void *ptr) · line 181

Quoted 5 lines
tools/ioemu/osdep.c +1 -1
@@ -178,7 +178,7 @@ void kqemu_vfree(void *ptr)
 
 void *qemu_memalign(size_t alignment, size_t size)
 {
-#if defined(_POSIX_C_SOURCE)
+#if defined(__Linux__)

That's wrong. NetBSD also has posix_memalign().
Maybe this:

#ifndef __sun__

Quoted 8 lines
tools/ioemu/osdep.c +0 -0
     int ret;
     void *ptr;
     ret = posix_memalign(&ptr, alignment, size);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 12 lines
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy
#2 lore raw
Quoted 7 lines · Christoph Egger

tools/ioemu/osdep.c void kqemu_vfree(void *ptr) · line 181

Quoted 2 lines
tools/ioemu/osdep.c +1 -1
-#if defined(_POSIX_C_SOURCE)
+#if defined(__Linux__)

That's wrong. NetBSD also has posix_memalign().
Maybe this:

#ifndef __sun__

I shall opt for defined(_POSIX_C_SOURCE) && !defined(__sun__)

-- Keir