From 6d06a6371b67caafdf29ca76af8b119e1642eb9a Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Wed, 6 Jul 2005 09:56:42 +0000 Subject: Partial update from FreeBSD. --- cpukit/libnetworking/sys/uio.h | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'cpukit/libnetworking') diff --git a/cpukit/libnetworking/sys/uio.h b/cpukit/libnetworking/sys/uio.h index 693bde1d82..50047c58f4 100644 --- a/cpukit/libnetworking/sys/uio.h +++ b/cpukit/libnetworking/sys/uio.h @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -31,12 +27,18 @@ * SUCH DAMAGE. * * @(#)uio.h 8.5 (Berkeley) 2/22/94 + * $FreeBSD: src/sys/sys/uio.h,v 1.38 2005/01/07 02:29:24 imp Exp $ + */ + +/* * $Id$ */ #ifndef _SYS_UIO_H_ #define _SYS_UIO_H_ +#include + /* * XXX * iov_base should be a void *. @@ -46,6 +48,7 @@ struct iovec { size_t iov_len; /* Length. */ }; +#if __BSD_VISIBLE enum uio_rw { UIO_READ, UIO_WRITE }; /* Segment flag values. */ @@ -55,8 +58,10 @@ enum uio_seg { UIO_USERISPACE, /* from user I space */ UIO_NOCOPY /* don't copy, already in object */ }; +#endif #ifdef _KERNEL + struct uio { struct iovec *uio_iov; int uio_iovcnt; @@ -69,22 +74,24 @@ struct uio { /* * Limits + * + * N.B.: UIO_MAXIOV must be no less than IOV_MAX from + * which in turn must be no less than _XOPEN_IOV_MAX from . If + * we ever make this tunable (probably pointless), then IOV_MAX should be + * removed from and applications would be expected to use + * sysconf(3) to find out the correct value, or else assume the worst + * (_XOPEN_IOV_MAX). Perhaps UIO_MAXIOV should be simply defined as + * IOV_MAX. */ #define UIO_MAXIOV 1024 /* max 1K of iov's */ -#define UIO_SMALLIOV 8 /* 8 on stack, else malloc */ -#endif /* _KERNEL */ - -#ifdef _KERNEL -int uiomove __P((caddr_t, int, struct uio *)); +int uiomove(void *cp, int n, struct uio *uio); #else /* !_KERNEL */ -#include - __BEGIN_DECLS -ssize_t readv __P((int, const struct iovec *, int)); -ssize_t writev __P((int, const struct iovec *, int)); +ssize_t readv(int, const struct iovec *, int); +ssize_t writev(int, const struct iovec *, int); __END_DECLS #endif /* _KERNEL */ -- cgit v1.2.3