aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_netbsd.c
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@entel.upc.edu>2012-01-19 11:21:10 +0100
committerRoger Pau Monne <roger.pau@entel.upc.edu>2012-01-19 11:21:10 +0100
commitb21046d2eaad49c6e943c1618ba07a9b7da9cd0d (patch)
treefd863a9ffb18258a1283939922b7407ef00df20a /tools/libxc/xc_netbsd.c
parent089179f6f330d820234780ebaeb79614f4d2d9ba (diff)
downloadxen-b21046d2eaad49c6e943c1618ba07a9b7da9cd0d.tar.gz
xen-b21046d2eaad49c6e943c1618ba07a9b7da9cd0d.tar.bz2
xen-b21046d2eaad49c6e943c1618ba07a9b7da9cd0d.zip
libxc: add comment to why NetBSD return hypercall->retval
Added a comment that explains why NetBSD return hypercall->retval on success. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Reported-by: Olaf Hering <olaf@aepfle.de>
Diffstat (limited to 'tools/libxc/xc_netbsd.c')
-rw-r--r--tools/libxc/xc_netbsd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 9782a3423a..b6d67bbb8c 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -96,6 +96,12 @@ static int netbsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcm
int fd = (int)h;
int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+ /*
+ * Since NetBSD ioctl can only return 0 on success or < 0 on
+ * error, if we want to return a value from ioctl we should
+ * do so by setting hypercall->retval, to mimic Linux ioctl
+ * implementation.
+ */
if (error < 0)
return -errno;
else