# HG changeset patch # User dholmes # Date 1292551023 18000 # Node ID 3f956542f1fd20c3485e265739ccce1e2bb4c48e # Parent 230ed512b4b83584b5307d7b4ffb1fb4158b2b70 7003707: need to remove (some) system include files from the HotSpot header files Summary: move socket_available into os_linux.cpp to avoid inclusion of ioctl.h in os_linux.inline.hpp Reviewed-by: coleenp, stefank, ikrylov diff -r 230ed512b4b8 -r 3f956542f1fd hotspot/src/os/linux/vm/os_linux.cpp --- a/hotspot/src/os/linux/vm/os_linux.cpp Thu Dec 16 12:56:51 2010 -0800 +++ b/hotspot/src/os/linux/vm/os_linux.cpp Thu Dec 16 20:57:03 2010 -0500 @@ -115,6 +115,7 @@ # include # include # include +# include #define MAX_PATH (2 * K) @@ -4433,6 +4434,15 @@ return 1; } +int os::socket_available(int fd, jint *pbytes) { + // Linux doc says EINTR not returned, unlike Solaris + int ret = ::ioctl(fd, FIONREAD, pbytes); + + //%% note ioctl can return 0 when successful, JVM_SocketAvailable + // is expected to return 0 on failure and 1 on success to the jdk. + return (ret < 0) ? 0 : 1; +} + // Map a block of memory. char* os::map_memory(int fd, const char* file_name, size_t file_offset, char *addr, size_t bytes, bool read_only, diff -r 230ed512b4b8 -r 3f956542f1fd hotspot/src/os/linux/vm/os_linux.inline.hpp --- a/hotspot/src/os/linux/vm/os_linux.inline.hpp Thu Dec 16 12:56:51 2010 -0800 +++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp Thu Dec 16 20:57:03 2010 -0500 @@ -45,7 +45,6 @@ #include #include #include -#include #include inline void* os::thread_local_storage_at(int index) { @@ -268,16 +267,6 @@ RESTARTABLE_RETURN_INT(::sendto(fd, buf, len, (unsigned int) flags, to, tolen)); } -inline int os::socket_available(int fd, jint *pbytes) { - // Linux doc says EINTR not returned, unlike Solaris - int ret = ::ioctl(fd, FIONREAD, pbytes); - - //%% note ioctl can return 0 when successful, JVM_SocketAvailable - // is expected to return 0 on failure and 1 on success to the jdk. - return (ret < 0) ? 0 : 1; -} - - inline int os::socket_shutdown(int fd, int howto){ return ::shutdown(fd, howto); }