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>
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