Print this page
5880 Increase IOV_MAX to at least 1024
Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.

  25  */
  26 
  27 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  28 /*        All Rights Reserved   */
  29 
  30 
  31 #ifndef _SYS_STREAM_H
  32 #define _SYS_STREAM_H
  33 
  34 /*
  35  * For source compatibility
  36  */
  37 #include <sys/isa_defs.h>
  38 #if defined(_KERNEL) || defined(_FAKE_KERNEL)
  39 #include <sys/kmem.h>
  40 #include <sys/uio.h>
  41 #endif
  42 #include <sys/poll.h>
  43 #include <sys/strmdep.h>
  44 #include <sys/cred.h>


 627 #define SO_MREADOFF     0x0080  /* set read notification OFF */
 628 #define SO_NDELON       0x0100  /* old TTY semantics for NDELAY reads/writes */
 629 #define SO_NDELOFF      0x0200  /* STREAMS semantics for NDELAY reads/writes */
 630 #define SO_ISTTY        0x0400  /* the stream is acting as a terminal */
 631 #define SO_ISNTTY       0x0800  /* the stream is not acting as a terminal */
 632 #define SO_TOSTOP       0x1000  /* stop on background writes to this stream */
 633 #define SO_TONSTOP      0x2000  /* do not stop on background writes to stream */
 634 #define SO_BAND         0x4000  /* water marks affect band */
 635 #define SO_DELIM        0x8000  /* messages are delimited */
 636 #define SO_NODELIM      0x010000        /* turn off delimiters */
 637 #define SO_STRHOLD      0x020000        /* No longer implemented */
 638 #define SO_ERROPT       0x040000        /* set error option */
 639 #define SO_COPYOPT      0x080000        /* copy option(s) present */
 640 #define SO_MAXBLK       0x100000        /* set maximum message block size */
 641 #define SO_TAIL         0x200000        /* set the extra allocated space */
 642 
 643 #if defined(_KERNEL) || defined(_FAKE_KERNEL)
 644 /*
 645  * Structure for rw (read/write) procedure calls. A pointer
 646  * to a struiod_t is passed as a parameter to the rwnext() call.
 647  *
 648  * Note: DEF_IOV_MAX is defined and used as it is in "fs/vncalls.c"
 649  *       as there isn't a formal definition of IOV_MAX ???
 650  */
 651 #define DEF_IOV_MAX     16
 652 
 653 struct struiod {
 654         mblk_t          *d_mp;          /* pointer to mblk (chain) */
 655         uio_t           d_uio;          /* uio info */
 656         iovec_t d_iov[DEF_IOV_MAX];     /* iov referenced by uio */
 657 };
 658 
 659 /*
 660  * Structure for information procedure calls.
 661  */
 662 struct infod {
 663         unsigned char   d_cmd;          /* info info request command */
 664         unsigned char   d_res;          /* info info command results */
 665         int             d_bytes;        /* mblk(s) byte count */
 666         int             d_count;        /* count of mblk(s) */
 667         uio_t           *d_uiop;        /* pointer to uio struct */
 668 };
 669 /*
 670  * Values for d_cmd & d_res.
 671  */
 672 #define INFOD_FIRSTBYTES        0x02    /* return msgbsize() of first mblk */
 673 #define INFOD_BYTES             0x04    /* return msgbsize() of all mblk(s) */
 674 #define INFOD_COUNT             0x08    /* return count of mblk(s) */
 675 #define INFOD_COPYOUT           0x10    /* copyout any M_DATA mblk(s) */
 676 




   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
  25  * Copyright 2015 Joyent, Inc.  All rights reserved.
  26  */
  27 
  28 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  29 /*        All Rights Reserved   */
  30 
  31 
  32 #ifndef _SYS_STREAM_H
  33 #define _SYS_STREAM_H
  34 
  35 /*
  36  * For source compatibility
  37  */
  38 #include <sys/isa_defs.h>
  39 #if defined(_KERNEL) || defined(_FAKE_KERNEL)
  40 #include <sys/kmem.h>
  41 #include <sys/uio.h>
  42 #endif
  43 #include <sys/poll.h>
  44 #include <sys/strmdep.h>
  45 #include <sys/cred.h>


 628 #define SO_MREADOFF     0x0080  /* set read notification OFF */
 629 #define SO_NDELON       0x0100  /* old TTY semantics for NDELAY reads/writes */
 630 #define SO_NDELOFF      0x0200  /* STREAMS semantics for NDELAY reads/writes */
 631 #define SO_ISTTY        0x0400  /* the stream is acting as a terminal */
 632 #define SO_ISNTTY       0x0800  /* the stream is not acting as a terminal */
 633 #define SO_TOSTOP       0x1000  /* stop on background writes to this stream */
 634 #define SO_TONSTOP      0x2000  /* do not stop on background writes to stream */
 635 #define SO_BAND         0x4000  /* water marks affect band */
 636 #define SO_DELIM        0x8000  /* messages are delimited */
 637 #define SO_NODELIM      0x010000        /* turn off delimiters */
 638 #define SO_STRHOLD      0x020000        /* No longer implemented */
 639 #define SO_ERROPT       0x040000        /* set error option */
 640 #define SO_COPYOPT      0x080000        /* copy option(s) present */
 641 #define SO_MAXBLK       0x100000        /* set maximum message block size */
 642 #define SO_TAIL         0x200000        /* set the extra allocated space */
 643 
 644 #if defined(_KERNEL) || defined(_FAKE_KERNEL)
 645 /*
 646  * Structure for rw (read/write) procedure calls. A pointer
 647  * to a struiod_t is passed as a parameter to the rwnext() call.



 648  */


 649 struct struiod {
 650         mblk_t          *d_mp;          /* pointer to mblk (chain) */
 651         uio_t           d_uio;          /* uio info */
 652         iovec_t         *d_iov;         /* iov referenced by uio */
 653 };
 654 
 655 /*
 656  * Structure for information procedure calls.
 657  */
 658 struct infod {
 659         unsigned char   d_cmd;          /* info info request command */
 660         unsigned char   d_res;          /* info info command results */
 661         int             d_bytes;        /* mblk(s) byte count */
 662         int             d_count;        /* count of mblk(s) */
 663         uio_t           *d_uiop;        /* pointer to uio struct */
 664 };
 665 /*
 666  * Values for d_cmd & d_res.
 667  */
 668 #define INFOD_FIRSTBYTES        0x02    /* return msgbsize() of first mblk */
 669 #define INFOD_BYTES             0x04    /* return msgbsize() of all mblk(s) */
 670 #define INFOD_COUNT             0x08    /* return count of mblk(s) */
 671 #define INFOD_COPYOUT           0x10    /* copyout any M_DATA mblk(s) */
 672