summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ff53285)
This allows an application to do a scatter/gather operation on a large
image buffer to avoid the extra memcpy.
Use autoconf to use UIO_MAXIOV where IOV_MAX is not available (and the
POSIX minimum of 16 where neither are available).
Reviewed-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Peter Harris <pharris@opentext.com>
AC_CHECK_HEADERS([tsol/label.h])
AC_CHECK_FUNCS([is_system_labeled])
AC_CHECK_HEADERS([tsol/label.h])
AC_CHECK_FUNCS([is_system_labeled])
+dnl check for IOV_MAX, and fall back to UIO_MAXIOV on BSDish systems
+AC_CHECK_DECL([IOV_MAX], [],
+ [AC_CHECK_DECL([UIO_MAXIOV], [AC_DEFINE([IOV_MAX], [UIO_MAXIOV])],
+ [AC_DEFINE([IOV_MAX], [16], [Define if not provided by <limits.h>])],
+ [[#include <sys/uio.h>]])],
+ [[#include <limits.h>]])
+
xcbincludedir='${includedir}/xcb'
AC_SUBST(xcbincludedir)
xcbincludedir='${includedir}/xcb'
AC_SUBST(xcbincludedir)
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include "xcb.h"
#include "xcbint.h"
#include "xcb.h"
#include "xcbint.h"
- n = writev(c->fd, *vector, *count);
+ n = *count;
+ if (n > IOV_MAX)
+ n = IOV_MAX;
+
+ n = writev(c->fd, *vector, n);
if(n < 0 && errno == EAGAIN)
return 1;
#endif /* _WIN32 */
if(n < 0 && errno == EAGAIN)
return 1;
#endif /* _WIN32 */