Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 May 2001 22:36:13 -0400
From:      John <jwd@bsdwins.com>
To:        Hackers List <freebsd-hackers@freebsd.org>
Subject:   sys/uio.h UIO_MAXIOV hidden inside _KERNEL
Message-ID:  <20010524223613.A23038@bsdwins.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010524223613.A23038>