From owner-freebsd-hackers Thu May 24 19:36:39 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bsdone.bsdwins.com (www.bsdwins.com [192.58.184.33]) by hub.freebsd.org (Postfix) with ESMTP id B037C37B422 for ; Thu, 24 May 2001 19:36:34 -0700 (PDT) (envelope-from jwd@bsdwins.com) Received: (from jwd@localhost) by bsdone.bsdwins.com (8.11.3/8.11.0) id f4P2aDw23093 for freebsd-hackers@freebsd.org; Thu, 24 May 2001 22:36:13 -0400 (EDT) (envelope-from jwd) Date: Thu, 24 May 2001 22:36:13 -0400 From: John To: Hackers List Subject: sys/uio.h UIO_MAXIOV hidden inside _KERNEL Message-ID: <20010524223613.A23038@bsdwins.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, Can someone provide some insight as to why UIO_MAXIOV is hidden inside _KERNEL? #ifdef _KERNEL struct uio { struct iovec *uio_iov; int uio_iovcnt; off_t uio_offset; int uio_resid; enum uio_seg uio_segflg; enum uio_rw uio_rw; struct proc *uio_procp; }; /* * Limits */ #define UIO_MAXIOV 1024 /* max 1K of iov's */ #define UIO_SMALLIOV 8 /* 8 on stack, else malloc */ UIO_MAXIOV is needed in userland to determine the maximum size of the iovec array that can be sent to readv/writev. Basically, when I get the prototypes for readv/writev, I'd also like to get the relevant arguement size limits without having to say I'm kernel code. I'm iffy on whether UIO_SMALLIOV should be made visible since it's only used in the kernel to decide how to allocate memory prior to copy in data from the user process. The following patch simply moves them down and adds a tad bit of documentation: Index: uio.h =================================================================== RCS file: /home/ncvs/src/sys/sys/uio.h,v retrieving revision 1.12 diff -u -r1.12 uio.h --- uio.h 2001/02/16 14:31:49 1.12 +++ uio.h 2001/05/25 02:32:50 @@ -68,11 +68,6 @@ struct proc *uio_procp; }; -/* - * Limits - */ -#define UIO_MAXIOV 1024 /* max 1K of iov's */ -#define UIO_SMALLIOV 8 /* 8 on stack, else malloc */ struct vm_object; @@ -91,6 +86,12 @@ ssize_t readv __P((int, const struct iovec *, int)); ssize_t writev __P((int, const struct iovec *, int)); __END_DECLS + +/* + * iovec array size limits + */ +#define UIO_MAXIOV 1024 /* max 1K of iov's */ +#define UIO_SMALLIOV 8 /* 8 on stack, else malloc */ #endif /* _KERNEL */ Comments? -john To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message