Print this page
OS-4602 lxbrand support recvmsg(MSG_PEEK|MSG_TRUNC) behavior
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Joshua M. Clulow <jmc@joyent.com>

@@ -143,11 +143,12 @@
  *
  * PSARC 2009/478: Copy Reduction Interfaces
  */
 typedef enum xuio_type {
         UIOTYPE_ASYNCIO,
-        UIOTYPE_ZEROCOPY
+        UIOTYPE_ZEROCOPY,
+        UIOTYPE_PEEKSIZE
 } xuio_type_t;
 
 typedef struct xuio {
         uio_t xu_uio;           /* Embedded UIO structure */
 

@@ -173,10 +174,19 @@
                  */
                 struct {
                         int xu_zc_rw;   /* read or write buffer */
                         void *xu_zc_priv;       /* fs specific */
                 } xu_zc;
+
+                /*
+                 * Peek Size Support -- facilitate peeking at the size of a
+                 * waiting message on a socket.
+                 */
+                struct {
+                        ssize_t xu_ps_size;     /* size of waiting msg */
+                        boolean_t xu_ps_set;    /* was size calculated? */
+                } xu_ps;
         } xu_ext;
 } xuio_t;
 
 #define XUIO_XUZC_PRIV(xuio)    xuio->xu_ext.xu_zc.xu_zc_priv
 #define XUIO_XUZC_RW(xuio)      xuio->xu_ext.xu_zc.xu_zc_rw