diff -r 7a0f1bf86516 tools/include/xen-sys/NetBSD/privcmd.h --- a/tools/include/xen-sys/NetBSD/privcmd.h Tue Jun 10 09:27:01 2008 +0100 +++ b/tools/include/xen-sys/NetBSD/privcmd.h Tue Jun 10 10:49:17 2008 +0200 @@ -36,6 +36,7 @@ typedef struct privcmd_hypercall { unsigned long op; unsigned long arg[5]; + long retval; } privcmd_hypercall_t; typedef struct privcmd_mmap_entry { diff -r 7a0f1bf86516 tools/libxc/xc_netbsd.c --- a/tools/libxc/xc_netbsd.c Tue Jun 10 09:27:01 2008 +0100 +++ b/tools/libxc/xc_netbsd.c Tue Jun 10 10:49:17 2008 +0200 @@ -142,9 +142,13 @@ static int do_privcmd(int xc_handle, uns int do_xen_hypercall(int xc_handle, privcmd_hypercall_t *hypercall) { - return do_privcmd(xc_handle, + int error = do_privcmd(xc_handle, IOCTL_PRIVCMD_HYPERCALL, (unsigned long)hypercall); + if (error) + return error; + else + return (hypercall->retval); } #define EVTCHN_DEV_NAME "/dev/xenevt"