src/share/vm/utilities/ostream.cpp

changeset 2322
828eafbd85cc
parent 2314
f95d63e2154a
child 2515
d8a72fbc4be7
     1.1 --- a/src/share/vm/utilities/ostream.cpp	Tue Nov 23 13:22:55 2010 -0800
     1.2 +++ b/src/share/vm/utilities/ostream.cpp	Wed Dec 01 18:26:32 2010 -0500
     1.3 @@ -26,21 +26,17 @@
     1.4  #include "compiler/compileLog.hpp"
     1.5  #include "oops/oop.inline.hpp"
     1.6  #include "runtime/arguments.hpp"
     1.7 -#include "runtime/hpi.hpp"
     1.8  #include "utilities/defaultStream.hpp"
     1.9  #include "utilities/ostream.hpp"
    1.10  #include "utilities/top.hpp"
    1.11  #include "utilities/xmlstream.hpp"
    1.12  #ifdef TARGET_OS_FAMILY_linux
    1.13 -# include "hpi_linux.hpp"
    1.14  # include "os_linux.inline.hpp"
    1.15  #endif
    1.16  #ifdef TARGET_OS_FAMILY_solaris
    1.17 -# include "hpi_solaris.hpp"
    1.18  # include "os_solaris.inline.hpp"
    1.19  #endif
    1.20  #ifdef TARGET_OS_FAMILY_windows
    1.21 -# include "hpi_windows.hpp"
    1.22  # include "os_windows.inline.hpp"
    1.23  #endif
    1.24  
    1.25 @@ -879,9 +875,7 @@
    1.26  
    1.27    _socket = -1;
    1.28  
    1.29 -  hpi::initialize_socket_library();
    1.30 -
    1.31 -  int result = hpi::socket(AF_INET, SOCK_STREAM, 0);
    1.32 +  int result = os::socket(AF_INET, SOCK_STREAM, 0);
    1.33    if (result <= 0) {
    1.34      assert(false, "Socket could not be created!");
    1.35    } else {
    1.36 @@ -890,12 +884,12 @@
    1.37  }
    1.38  
    1.39  int networkStream::read(char *buf, size_t len) {
    1.40 -  return hpi::recv(_socket, buf, (int)len, 0);
    1.41 +  return os::recv(_socket, buf, (int)len, 0);
    1.42  }
    1.43  
    1.44  void networkStream::flush() {
    1.45    if (size() != 0) {
    1.46 -    int result = hpi::raw_send(_socket, (char *)base(), (int)size(), 0);
    1.47 +    int result = os::raw_send(_socket, (char *)base(), (int)size(), 0);
    1.48      assert(result != -1, "connection error");
    1.49      assert(result == (int)size(), "didn't send enough data");
    1.50    }
    1.51 @@ -909,7 +903,7 @@
    1.52  void networkStream::close() {
    1.53    if (_socket != -1) {
    1.54      flush();
    1.55 -    hpi::socket_close(_socket);
    1.56 +    os::socket_close(_socket);
    1.57      _socket = -1;
    1.58    }
    1.59  }
    1.60 @@ -922,11 +916,7 @@
    1.61  
    1.62    server.sin_addr.s_addr = inet_addr(ip);
    1.63    if (server.sin_addr.s_addr == (uint32_t)-1) {
    1.64 -#ifdef _WINDOWS
    1.65 -    struct hostent* host = hpi::get_host_by_name((char*)ip);
    1.66 -#else
    1.67 -    struct hostent* host = gethostbyname(ip);
    1.68 -#endif
    1.69 +    struct hostent* host = os::get_host_by_name((char*)ip);
    1.70      if (host != NULL) {
    1.71        memcpy(&server.sin_addr, host->h_addr_list[0], host->h_length);
    1.72      } else {
    1.73 @@ -935,7 +925,7 @@
    1.74    }
    1.75  
    1.76  
    1.77 -  int result = hpi::connect(_socket, (struct sockaddr*)&server, sizeof(struct sockaddr_in));
    1.78 +  int result = os::connect(_socket, (struct sockaddr*)&server, sizeof(struct sockaddr_in));
    1.79    return (result >= 0);
    1.80  }
    1.81  

mercurial