Date: Sat, 26 May 2001 20:55:09 -0700 From: John <jwd@FreeBSD.org> To: Current List <freebsd-current@FreeBSD.org> Subject: Correctness of UIO_MAXIOV definition? Message-ID: <20010526205509.A14824@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
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
                 <limits.h> 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
                 <limits.h>.                                   |
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010526205509.A14824>
