mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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>
This commit is contained in:
1 parent
089179f6f3
commit
b21046d2ea
1 file changed
+6
@@ -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
|
||||
|
||||