diff --git a/configure.ac b/configure.ac index 4f74911..1d180e1 100644 --- a/configure.ac +++ b/configure.ac @@ -461,14 +461,6 @@ AC_DEFINE_UNQUOTED([DBUS_CLIENT_GROUP], ["${DBUS_CLIENT_GROUP}"], [DBus client g AC_MSG_RESULT(${DBUS_CLIENT_GROUP}) AC_SUBST([DBUS_CLIENT_GROUP]) -dnl Check for clock_gettime. Some systems put it into -lc, while -dnl others use -lrt. Try the first and fallback to the latter. -RT_LIB= -AC_CHECK_FUNC([clock_gettime], [:], - [AC_CHECK_LIB([rt], [clock_gettime], [RT_LIB="-lrt"], - [AC_MSG_ERROR([Your system lacks clock_gettime])])]) -AC_SUBST(RT_LIB) - PKG_CHECK_MODULES([LIBEVENT], [libevent >= 2.0]) have_dbus=false diff --git a/src/util.c b/src/util.c index 6bb279c..629ec22 100644 --- a/src/util.c +++ b/src/util.c @@ -290,7 +290,12 @@ int file_write(int fd, void *buf, size_t sz) ssize_t ret; iov[0].iov_base = buf; iov[0].iov_len = sz; +#ifdef HAVE_PWRITEV ret = IGNORE_EINTR (pwritev (fd, iov, 1, 0)); +#else + lseek (fd, 0, SEEK_SET); + ret = IGNORE_EINTR (writev (fd, iov, 1)); +#endif if (ret != sz) { return -1; @@ -332,7 +337,12 @@ int file_read(int fd, void *buf, size_t sz) struct iovec iov[1]; iov[0].iov_base = buf; iov[0].iov_len = sz; +#ifdef HAVE_PREADV if (preadv (fd, iov, 1, 0) != sz) +#else + lseek (fd, 0, SEEK_SET); + if (readv (fd, iov, 1) != sz) +#endif { /* Returns -1 on read failure */ return -1;