jdk/src/solaris/native/java/net/net_util_md.c
changeset 22597 7515a991bb37
parent 20821 e0d0a585aa49
child 22605 dba3d6b22818
equal deleted inserted replaced
22596:62542b8be764 22597:7515a991bb37
   736         }
   736         }
   737     }
   737     }
   738     return 0;
   738     return 0;
   739 }
   739 }
   740 
   740 
   741 void initLocalAddrTable () {
   741 void platformInit () {
   742     initLoopbackRoutes();
   742     initLoopbackRoutes();
   743     initLocalIfs();
   743     initLocalIfs();
   744 }
   744 }
   745 
   745 
       
   746 #elif defined(_AIX)
       
   747 
       
   748 /* Initialize stubs for blocking I/O workarounds (see src/solaris/native/java/net/linux_close.c) */
       
   749 extern void aix_close_init();
       
   750 
       
   751 void platformInit () {
       
   752     aix_close_init();
       
   753 }
       
   754 
   746 #else
   755 #else
   747 
   756 
   748 void initLocalAddrTable () {}
   757 void platformInit () {}
   749 
   758 
   750 #endif
   759 #endif
   751 
   760 
   752 void parseExclusiveBindProperty(JNIEnv *env) {
   761 void parseExclusiveBindProperty(JNIEnv *env) {
   753 #ifdef __solaris__
   762 #ifdef __solaris__
   985         { java_net_SocketOptions_SO_OOBINLINE,          SOL_SOCKET,     SO_OOBINLINE },
   994         { java_net_SocketOptions_SO_OOBINLINE,          SOL_SOCKET,     SO_OOBINLINE },
   986         { java_net_SocketOptions_SO_LINGER,             SOL_SOCKET,     SO_LINGER },
   995         { java_net_SocketOptions_SO_LINGER,             SOL_SOCKET,     SO_LINGER },
   987         { java_net_SocketOptions_SO_SNDBUF,             SOL_SOCKET,     SO_SNDBUF },
   996         { java_net_SocketOptions_SO_SNDBUF,             SOL_SOCKET,     SO_SNDBUF },
   988         { java_net_SocketOptions_SO_RCVBUF,             SOL_SOCKET,     SO_RCVBUF },
   997         { java_net_SocketOptions_SO_RCVBUF,             SOL_SOCKET,     SO_RCVBUF },
   989         { java_net_SocketOptions_SO_KEEPALIVE,          SOL_SOCKET,     SO_KEEPALIVE },
   998         { java_net_SocketOptions_SO_KEEPALIVE,          SOL_SOCKET,     SO_KEEPALIVE },
       
   999 #if defined(_AIX)
       
  1000         { java_net_SocketOptions_SO_REUSEADDR,          SOL_SOCKET,     SO_REUSEPORT },
       
  1001 #else
   990         { java_net_SocketOptions_SO_REUSEADDR,          SOL_SOCKET,     SO_REUSEADDR },
  1002         { java_net_SocketOptions_SO_REUSEADDR,          SOL_SOCKET,     SO_REUSEADDR },
       
  1003 #endif
   991         { java_net_SocketOptions_SO_BROADCAST,          SOL_SOCKET,     SO_BROADCAST },
  1004         { java_net_SocketOptions_SO_BROADCAST,          SOL_SOCKET,     SO_BROADCAST },
   992         { java_net_SocketOptions_IP_TOS,                IPPROTO_IP,     IP_TOS },
  1005         { java_net_SocketOptions_IP_TOS,                IPPROTO_IP,     IP_TOS },
   993         { java_net_SocketOptions_IP_MULTICAST_IF,       IPPROTO_IP,     IP_MULTICAST_IF },
  1006         { java_net_SocketOptions_IP_MULTICAST_IF,       IPPROTO_IP,     IP_MULTICAST_IF },
   994         { java_net_SocketOptions_IP_MULTICAST_IF2,      IPPROTO_IP,     IP_MULTICAST_IF },
  1007         { java_net_SocketOptions_IP_MULTICAST_IF2,      IPPROTO_IP,     IP_MULTICAST_IF },
   995         { java_net_SocketOptions_IP_MULTICAST_LOOP,     IPPROTO_IP,     IP_MULTICAST_LOOP },
  1008         { java_net_SocketOptions_IP_MULTICAST_LOOP,     IPPROTO_IP,     IP_MULTICAST_LOOP },
  1385             }
  1398             }
  1386         }
  1399         }
  1387     }
  1400     }
  1388 #endif
  1401 #endif
  1389 
  1402 
       
  1403 #ifdef _AIX
       
  1404     if (level == SOL_SOCKET) {
       
  1405         if (opt == SO_SNDBUF || opt == SO_RCVBUF) {
       
  1406             /*
       
  1407              * Just try to set the requested size. If it fails we will leave the
       
  1408              * socket option as is. Setting the buffer size means only a hint in
       
  1409              * the jse2/java software layer, see javadoc. In the previous
       
  1410              * solution the buffer has always been truncated to a length of
       
  1411              * 0x100000 Byte, even if the technical limit has not been reached.
       
  1412              * This kind of absolute truncation was unexpected in the jck tests.
       
  1413              */
       
  1414             int ret = setsockopt(fd, level, opt, arg, len);
       
  1415             if ((ret == 0) || (ret == -1 && errno == ENOBUFS)) {
       
  1416                 // Accept failure because of insufficient buffer memory resources.
       
  1417                 return 0;
       
  1418             } else {
       
  1419                 // Deliver all other kinds of errors.
       
  1420                 return ret;
       
  1421             }
       
  1422         }
       
  1423     }
       
  1424 #endif
       
  1425 
  1390     /*
  1426     /*
  1391      * On Linux the receive buffer is used for both socket
  1427      * On Linux the receive buffer is used for both socket
  1392      * structures and the the packet payload. The implication
  1428      * structures and the the packet payload. The implication
  1393      * is that if SO_RCVBUF is too small then small packets
  1429      * is that if SO_RCVBUF is too small then small packets
  1394      * must be discard.
  1430      * must be discard.