[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH 15/15] plat/linuxu: Convert linux errno to unikraft errno
There are differences in errno between linux and unikraft. This patch converts EAGAIN which is 11 in linux to unikraft which is 35. Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx> --- plat/linuxu/tap_io.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plat/linuxu/tap_io.c b/plat/linuxu/tap_io.c index 44c6135..f4f44b3 100644 --- a/plat/linuxu/tap_io.c +++ b/plat/linuxu/tap_io.c @@ -112,7 +112,10 @@ ssize_t tap_read(int fd, void *buf, size_t count) while (rc == -EINTR) rc = sys_read(fd, buf, count); - if (rc < 0) + if (rc == -11) + /* Explicitly added since linux errno has -11 for EAGAIN */ + rc = -EWOULDBLOCK; + else if (rc < 0) uk_pr_err("Failed(%ld) to read from the tap device\n", rc); return rc; @@ -127,7 +130,10 @@ ssize_t tap_write(int fd, const void *buf, size_t count) rc = sys_write(fd, buf, count); if (rc == -EINTR) continue; - else if (rc < 0) { + else if (rc == -11) { + /* Explicitly added since linux errno has -11 for EAGAIN */ + rc = -EWOULDBLOCK; + } else if (rc < 0) { uk_pr_err("Failed(%ld) to write to the tap device\n", rc); return rc; -- 2.7.4 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |