From b21046d2eaad49c6e943c1618ba07a9b7da9cd0d Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Thu, 19 Jan 2012 11:21:10 +0100 Subject: 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 Acked-by: Ian Campbell Committed-by: Ian Jackson Reported-by: Olaf Hering --- tools/libxc/xc_netbsd.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3