Browse files

Fix compilation of nbd on Solaris (Andreas Faerber)

Compilation of QEMU is currently broken on Solaris due to nbd's use of _IO and
due to network libraries not being linked into qemu-img.

The attached patch adds the appropriate libraries (copied from
and includes an additional Sun-specific header for _IO.

With these fixes it compiles okay, on OpenSolaris snv_93 (amd64).

Signed-off-by: Andreas Faerber <> 
Signed-off-by: Anthony Liguori <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information...
1 parent 0fd70f8 commit 7e00eb9b98ba98963a669c72e43b06c41917f368 aliguori committed Aug 2, 2008
Showing with 7 additions and 0 deletions.
  1. +4 −0 Makefile
  2. +3 −0 nbd.c
@@ -24,6 +24,10 @@ endif
+LIBS+=-lsocket -lnsl -lresolv
all: $(TOOLS) $(DOCS) recurse-all
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
3 nbd.c
@@ -22,6 +22,9 @@
#include <errno.h>
#include <string.h>
#include <sys/ioctl.h>
+#ifdef __sun__
+#include <sys/ioccom.h>
#include <ctype.h>
#include <inttypes.h>
#include <sys/socket.h>

0 comments on commit 7e00eb9

Please sign in to comment.