From owner-freebsd-current Sat May 26 20:55:13 2001 Delivered-To: freebsd-current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 821) id 72C0E37B422; Sat, 26 May 2001 20:55:09 -0700 (PDT) Date: Sat, 26 May 2001 20:55:09 -0700 From: John To: Current List Subject: Correctness of UIO_MAXIOV definition? Message-ID: <20010526205509.A14824@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, A few days ago I posted a short message to hackers asking for input concerning the definition of UIO_MAXIOV. The definition of UIO_MAXIOV is hidden behind _KERNEL. I have a small patch I'd like to apply to simply move the #define outside of _KERNEL. The patch is below. The second question I have is more standards based. Should we consider changing UIO_MAXIOV to IOV_MAX or _XOPEN_IOV_MAX and deprecating the 1st? I am unclear on what the standard is for this. Draft 4 of the Austin Group Common Specifications seems to say: 9166 XSI {IOV_MAX} 9167 Maximum number of iovec structures that one process has available for use with readv( ) or 9168 writev( ). 9169 Minimum Acceptable Value: {_XOPEN_IOV_MAX} 9524 XSI {_XOPEN_IOV_MAX} 9525 Maximum number of iovec structures that one process has available for use with readv( ) or 9526 writev( ). 9694 * Under Runtime Invariant Values, {ATEXIT_MAX}, {IOV_MAX}, {PAGESIZE}, and 9695 {PAGE_SIZE} are added. 9696 * Under Minimum Values, {_XOPEN_IOV_MAX} is added. 13654 APPLICATION USAGE 13655 The implementation can put a limit on the number of scatter/gather elements which can be | 13656 processed in one call. The symbol {IOV_MAX} defined in should always be used to | 13657 learn about the limits instead of assuming a fixed value. | 13658 RATIONALE 13659 Traditionally, the maximum number of scatter/gather elements the system can process in one | 13660 call were descibed by the symbolic value {UIO_MAXIOV}. In IEEE Std. 1003.1-200x this value | 13661 was replaced by the constant {IOV_MAX} which can be found in . | 15151 The following symbolic constants shall be defined for sysconf(): 15198 XSI _SC_IOV_MAX Comments welcome. -john 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 */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message