From 6d4bafd03c84b03b1f904ca466ac2ac173a9626f Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Tue, 10 Aug 2004 17:49:53 +0000 Subject: [PATCH] work around a bug in Solaris by using pwrite instead of write; reported by michael.wookey at citrix.com.au svn:r118 --- devpoll.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/devpoll.c b/devpoll.c index 99d05413..5fafdf54 100644 --- a/devpoll.c +++ b/devpoll.c @@ -278,7 +278,11 @@ devpoll_add(void *arg, struct event *ev) dpev.fd = fd; dpev.events = events; dpev.revents = 0; - if (write(devpollop->dpfd, &dpev, sizeof(dpev)) == -1) + /* + * Due to a bug in Solaris, we have to use pwrite with an offset of 0. + * Write is limited to 2GB of data, until it will fail. + */ + if (pwrite(devpollop->dpfd, &dpev, sizeof(dpev), 0) == -1) return (-1); /* Update events responsible */ @@ -327,7 +331,7 @@ devpoll_del(void *arg, struct event *ev) dpev.events = events | POLLREMOVE; dpev.revents = 0; - if (write(devpollop->dpfd, &dpev, sizeof(dpev)) == -1) + if (pwrite(devpollop->dpfd, &dpev, sizeof(dpev), 0) == -1) return (-1); if (needreaddelete) -- 2.40.0