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>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/uio.h
          +++ new/usr/src/uts/common/sys/uio.h
↓ open down ↓ 137 lines elided ↑ open up ↑
 138  138          uioa_page_t     uioa_locked[UIOA_IOV_MAX]; /* Per iov locked pages */
 139  139  } uioa_t;
 140  140  
 141  141  /*
 142  142   * uio extensions
 143  143   *
 144  144   * PSARC 2009/478: Copy Reduction Interfaces
 145  145   */
 146  146  typedef enum xuio_type {
 147  147          UIOTYPE_ASYNCIO,
 148      -        UIOTYPE_ZEROCOPY
      148 +        UIOTYPE_ZEROCOPY,
      149 +        UIOTYPE_PEEKSIZE
 149  150  } xuio_type_t;
 150  151  
 151  152  typedef struct xuio {
 152  153          uio_t xu_uio;           /* Embedded UIO structure */
 153  154  
 154  155          /* Extended uio fields */
 155  156          enum xuio_type xu_type; /* What kind of uio structure? */
 156  157          union {
 157  158                  /* Async I/O Support, intend to replace uioa_t. */
 158  159                  struct {
↓ open down ↓ 9 lines elided ↑ open up ↑
 168  169                  } xu_aio;
 169  170  
 170  171                  /*
 171  172                   * Copy Reduction Support -- facilate loaning / returning of
 172  173                   * filesystem cache buffers.
 173  174                   */
 174  175                  struct {
 175  176                          int xu_zc_rw;   /* read or write buffer */
 176  177                          void *xu_zc_priv;       /* fs specific */
 177  178                  } xu_zc;
      179 +
      180 +                /*
      181 +                 * Peek Size Support -- facilitate peeking at the size of a
      182 +                 * waiting message on a socket.
      183 +                 */
      184 +                struct {
      185 +                        ssize_t xu_ps_size;     /* size of waiting msg */
      186 +                        boolean_t xu_ps_set;    /* was size calculated? */
      187 +                } xu_ps;
 178  188          } xu_ext;
 179  189  } xuio_t;
 180  190  
 181  191  #define XUIO_XUZC_PRIV(xuio)    xuio->xu_ext.xu_zc.xu_zc_priv
 182  192  #define XUIO_XUZC_RW(xuio)      xuio->xu_ext.xu_zc.xu_zc_rw
 183  193  
 184  194  #define UIOA_ALLOC      0x0001          /* allocated but not yet initialized */
 185  195  #define UIOA_INIT       0x0002          /* initialized but not yet enabled */
 186  196  #define UIOA_ENABLED    0x0004          /* enabled, asynch i/o active */
 187  197  #define UIOA_FINI       0x0008          /* finished waiting for uioafini() */
↓ open down ↓ 118 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX