2 * <sys/uio.h> wrapper functions.
5 * Steffen Kiess (s-kiess@web.de)
7 * Copyright (C) 2012 Steffen Kiess
12 #endif /* ndef _GNU_SOURCE */
24 _mph_from_iovec_array (struct Mono_Posix_Iovec
*iov
, gint32 iovcnt
)
34 v
= malloc (iovcnt
* sizeof (struct iovec
));
39 for (i
= 0; i
< iovcnt
; i
++) {
40 if (Mono_Posix_FromIovec (&iov
[i
], &v
[i
]) != 0) {
51 Mono_Posix_Syscall_readv (int dirfd
, struct Mono_Posix_Iovec
*iov
, gint32 iovcnt
)
56 v
= _mph_from_iovec_array (iov
, iovcnt
);
61 res
= readv(dirfd
, v
, iovcnt
);
65 #endif /* def HAVE_READV */
69 Mono_Posix_Syscall_writev (int dirfd
, struct Mono_Posix_Iovec
*iov
, gint32 iovcnt
)
74 v
= _mph_from_iovec_array (iov
, iovcnt
);
79 res
= writev (dirfd
, v
, iovcnt
);
83 #endif /* def HAVE_WRITEV */
87 Mono_Posix_Syscall_preadv (int dirfd
, struct Mono_Posix_Iovec
*iov
, gint32 iovcnt
, gint64 off
)
92 mph_return_if_off_t_overflow (off
);
94 v
= _mph_from_iovec_array (iov
, iovcnt
);
99 res
= preadv (dirfd
, v
, iovcnt
, (off_t
) off
);
103 #endif /* def HAVE_PREADV */
107 Mono_Posix_Syscall_pwritev (int dirfd
, struct Mono_Posix_Iovec
*iov
, gint32 iovcnt
, gint64 off
)
112 mph_return_if_off_t_overflow (off
);
114 v
= _mph_from_iovec_array (iov
, iovcnt
);
119 res
= pwritev (dirfd
, v
, iovcnt
, (off_t
) off
);
123 #endif /* def HAVE_PWRITEV */