Commit e9f1b369 authored by Roger Pau Monne's avatar Roger Pau Monne

libxc: add comment to why NetBSD return hypercall->retval

Added a comment that explains why NetBSD return hypercall->retval on
success.
Signed-off-by: default avatarRoger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Reported-by: default avatarOlaf Hering <olaf@aepfle.de>
parent 1d2ce98f
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment