www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/11/06/07:23:14

From: gmarzot AT baynetworks DOT com (Joe Marzot)
Subject: Re: sys/uio.h not found in gnuwin32
6 Nov 1996 07:23:14 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <pdzq0v9tyw.fsf.cygnus.gnu-win32@baynetworks.com>
References: <199611060903 DOT KAA02659 AT truk DOT brandinnovators DOT com>
Original-To: hans AT brandinnovators DOT com (Hans Zuidam)
Original-Cc: gnu-win32 AT cygnus DOT com
In-Reply-To: hans@brandinnovators.com's message of Wed, 6 Nov 1996 10:03:32 +0100 (MET)
X-Mailer: Gnus v5.2.2/Emacs 19.31
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019