aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_linux.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:47 +0000
committerIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:47 +0000
commit3361a9deea33fb852dc6f2c10c43c4cfeb897abf (patch)
treedb9aa2d01a7fb5ede02394942658a92a359cc87c /tools/libxc/xc_linux.c
parentdbb5c70a0d11b83cbc5b777ed5b5aa3684b61fef (diff)
downloadxen-3361a9deea33fb852dc6f2c10c43c4cfeb897abf.tar.gz
xen-3361a9deea33fb852dc6f2c10c43c4cfeb897abf.tar.bz2
xen-3361a9deea33fb852dc6f2c10c43c4cfeb897abf.zip
libxc: osdep: convert xc_evtchn_{pending,unmask}()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xc_linux.c')
-rw-r--r--tools/libxc/xc_linux.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
index 9044020fe8..188741f3df 100644
--- a/tools/libxc/xc_linux.c
+++ b/tools/libxc/xc_linux.c
@@ -420,20 +420,24 @@ static int linux_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
}
-evtchn_port_or_error_t
-xc_evtchn_pending(xc_evtchn *xce)
+static evtchn_port_or_error_t linux_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
{
+ int fd = (int)h;
evtchn_port_t port;
- if ( read_exact(xce->fd, (char *)&port, sizeof(port)) == -1 )
+ if ( read(fd, &port, sizeof(port)) != sizeof(port) )
return -1;
return port;
}
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
+static int linux_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
{
- return write_exact(xce->fd, (char *)&port, sizeof(port));
+ int fd = (int)h;
+
+ if ( write(fd, &port, sizeof(port)) != sizeof(port) )
+ return -1;
+ return 0;
}
static struct xc_osdep_ops linux_evtchn_ops = {
@@ -447,6 +451,8 @@ static struct xc_osdep_ops linux_evtchn_ops = {
.bind_interdomain = &linux_evtchn_bind_interdomain,
.bind_virq = &linux_evtchn_bind_virq,
.unbind = &linux_evtchn_unbind,
+ .pending = &linux_evtchn_pending,
+ .unmask = &linux_evtchn_unmask,
},
};