Print this page
12694 race between write() and shutdown() for unix sockets


   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 /*
  23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  * Copyright 2016 Nexenta Systems, Inc.

  26  */
  27 
  28 /*
  29  * The intent of this file is to contain any data that must remain
  30  * resident in the kernel.
  31  *
  32  * space_store(), space_fetch(), and space_free() have been added to
  33  * easily store and retrieve kernel resident data.
  34  * These functions are recommended rather than adding new variables to
  35  * this file.
  36  *
  37  * Note that it's possible for name collisions to occur.  In order to
  38  * prevent collisions, it's recommended that the convention in
  39  * PSARC/1997/389 be used.  If a collision occurs, then space_store will
  40  * fail.
  41  */
  42 
  43 #include <sys/types.h>
  44 #include <sys/param.h>
  45 #include <sys/var.h>


 125 #include <sys/dlpi.h>
 126 #include <net/if.h>
 127 
 128 int netboot;
 129 int obpdebug;
 130 char *dhcack;           /* dhcp response packet */
 131 int dhcacklen;
 132 char *netdev_path;      /* Used to cache the netdev_path handed up by boot */
 133 char dhcifname[IFNAMSIZ];
 134 
 135 /*
 136  * Data from arp.c that must be resident.
 137  */
 138 #include <net/if_arp.h>
 139 #include <netinet/in.h>
 140 #include <netinet/in_var.h>
 141 #include <netinet/if_ether.h>
 142 
 143 ether_addr_t etherbroadcastaddr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 144 
 145 
 146 /*
 147  * Data from timod that must be resident
 148  */
 149 
 150 /*
 151  * state transition table for TI interface
 152  */
 153 #include <sys/tihdr.h>
 154 
 155 #define nr      127             /* not reachable */
 156 
 157 char ti_statetbl[TE_NOEVENTS][TS_NOSTATES] = {
 158                                 /* STATES */
 159         /* 0  1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16 */
 160 
 161         { 1, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 162         {nr, nr, nr,  2, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 163         {nr, nr, nr,  4, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 164         {nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 165         {nr, nr, nr, nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 166         {nr,  0,  3, nr,  3,  3, nr, nr,  7, nr, nr, nr,  6,  7,  9, 10, 11},
 167         {nr, nr,  0, nr, nr,  6, nr, nr, nr, nr, nr, nr,  3, nr,  3,  3,  3},
 168         {nr, nr, nr, nr, nr, nr, nr, nr,  9, nr, nr, nr, nr,  3, nr, nr, nr},
 169         {nr, nr, nr, nr, nr, nr, nr, nr,  3, nr, nr, nr, nr,  3, nr, nr, nr},
 170         {nr, nr, nr, nr, nr, nr, nr, nr,  7, nr, nr, nr, nr,  7, nr, nr, nr},
 171         {nr, nr, nr,  5, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 172         {nr, nr, nr, nr, nr, nr, nr,  8, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 173         {nr, nr, nr, nr, nr, nr, 12, 13, nr, 14, 15, 16, nr, nr, nr, nr, nr},
 174         {nr, nr, nr, nr, nr, nr, nr, nr, nr,  9, nr, 11, nr, nr, nr, nr, nr},
 175         {nr, nr, nr, nr, nr, nr, nr, nr, nr,  9, nr, 11, nr, nr, nr, nr, nr},
 176         {nr, nr, nr, nr, nr, nr, nr, nr, nr, 10, nr,  3, nr, nr, nr, nr, nr},
 177         {nr, nr, nr,  7, nr, nr, nr,  7, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 178         {nr, nr, nr, nr, nr, nr,  9, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 179         {nr, nr, nr, nr, nr, nr, nr, nr, nr,  9, 10, nr, nr, nr, nr, nr, nr},
 180         {nr, nr, nr, nr, nr, nr, nr, nr, nr,  9, 10, nr, nr, nr, nr, nr, nr},
 181         {nr, nr, nr, nr, nr, nr, nr, nr, nr, 11,  3, nr, nr, nr, nr, nr, nr},
 182         {nr, nr, nr, nr, nr, nr,  3, nr, nr,  3,  3,  3, nr, nr, nr, nr, nr},
 183         {nr, nr, nr, nr, nr, nr, nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 184         {nr, nr, nr, nr, nr, nr, nr,  7, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 185         {nr, nr, nr,  9, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 186         {nr, nr, nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 187         {nr, nr, nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 188         {nr, nr, nr,  3, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr, nr},
 189 };
 190 
 191 
 192 #include <sys/tty.h>
 193 #include <sys/ptyvar.h>
 194 
 195 static void store_fetch_initspace();
 196 
 197 /*
 198  * Allocate tunable structures at runtime.
 199  */
 200 void
 201 space_init(void)
 202 {
 203         pty_initspace();
 204         store_fetch_initspace();
 205 }
 206 
 207 int ts_dispatch_extended = -1; /* set in ts_getdptbl or set_platform_default */
 208 
 209 /*
 210  * Previously defined in consmsconf.c ...
 211  */




   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 /*
  23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  * Copyright 2016 Nexenta Systems, Inc.
  26  * Copyright 2020 Joyent, Inc.
  27  */
  28 
  29 /*
  30  * The intent of this file is to contain any data that must remain
  31  * resident in the kernel.
  32  *
  33  * space_store(), space_fetch(), and space_free() have been added to
  34  * easily store and retrieve kernel resident data.
  35  * These functions are recommended rather than adding new variables to
  36  * this file.
  37  *
  38  * Note that it's possible for name collisions to occur.  In order to
  39  * prevent collisions, it's recommended that the convention in
  40  * PSARC/1997/389 be used.  If a collision occurs, then space_store will
  41  * fail.
  42  */
  43 
  44 #include <sys/types.h>
  45 #include <sys/param.h>
  46 #include <sys/var.h>


 126 #include <sys/dlpi.h>
 127 #include <net/if.h>
 128 
 129 int netboot;
 130 int obpdebug;
 131 char *dhcack;           /* dhcp response packet */
 132 int dhcacklen;
 133 char *netdev_path;      /* Used to cache the netdev_path handed up by boot */
 134 char dhcifname[IFNAMSIZ];
 135 
 136 /*
 137  * Data from arp.c that must be resident.
 138  */
 139 #include <net/if_arp.h>
 140 #include <netinet/in.h>
 141 #include <netinet/in_var.h>
 142 #include <netinet/if_ether.h>
 143 
 144 ether_addr_t etherbroadcastaddr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 145 















































 146 #include <sys/tty.h>
 147 #include <sys/ptyvar.h>
 148 
 149 static void store_fetch_initspace();
 150 
 151 /*
 152  * Allocate tunable structures at runtime.
 153  */
 154 void
 155 space_init(void)
 156 {
 157         pty_initspace();
 158         store_fetch_initspace();
 159 }
 160 
 161 int ts_dispatch_extended = -1; /* set in ts_getdptbl or set_platform_default */
 162 
 163 /*
 164  * Previously defined in consmsconf.c ...
 165  */