Mail Archives: cygwin/1996/11/06/07:23:14
hans AT brandinnovators DOT com (Hans Zuidam) writes:
>
> > Joe Marzot wrote:
> > not sure what the lineage of this header is but I find it available on
> > linux and SunOS but can't find it in the gnuwin32 stuff.
>
> Hi,
> The <sys/uio.h> is used for scattter/gather I/O and for user-land
> to kernel-land data movement in UNIX kernels. On the user-level
> of UNIX it is used by the system calls readv(2) and writev(2) (i.e.
> try man 2 readv on Solaris or Linux). If you're application really
> needs these two they could be implemented using ordinary read(2)/write(2)
> system calls. If you need more information drop me a line,
> Hans
>
Thanks for the reply.
The code I am trying to compile under gnu-win32 is db-1.85 (the bsd
db_file hashing, btree, rec_no stuff). If the writev(2) call can safely
be macro'd to something using write(2) that would be great. I am just
not familiar enough with what the desired behaviour or usage context is
for db-1.85's use of writev. Also not sure how the args would map.
Maybe writev makes no sense in a gnu-win32 compatibility env. as it
appears from your description to be UNIX kernel specific.
I wonder if cygnus has a reason for not supporting these calls
(writev(2)) in the distribution?
I have included a code snippet from db-1.84 recno/rec_close.c. Any
additional thoughts appreciated.
-GSM
--------<rec_close.c>--------
if (F_ISSET(t, R_FIXLEN)) {
/*
* We assume that fixed length records are all fixed length.
* Any that aren't are either EINVAL'd or corrected by the
* record put code.
*/
status = (dbp->seq)(dbp, &key, &data, R_FIRST);
while (status == RET_SUCCESS) {
if (write(t->bt_rfd, data.data, data.size) != data.size)
return (RET_ERROR);
status = (dbp->seq)(dbp, &key, &data, R_NEXT);
}
} else {
iov[1].iov_base = &t->bt_bval;
iov[1].iov_len = 1;
status = (dbp->seq)(dbp, &key, &data, R_FIRST);
while (status == RET_SUCCESS) {
iov[0].iov_base = data.data;
iov[0].iov_len = data.size;
if (writev(t->bt_rfd, iov, 2) != data.size + 1)
return (RET_ERROR);
status = (dbp->seq)(dbp, &key, &data, R_NEXT);
}
}
-----
--
Giovanni S. Marzot <gmarzot AT baynetworks DOT com> Senior Software Engineer
Bay Networks Inc. Network Management Development
--
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -