aboutsummaryrefslogtreecommitdiff
path: root/src/os/linux
diff options
context:
space:
mode:
authorcoleenp <none@none>2010-12-22 12:24:40 -0500
committercoleenp <none@none>2010-12-22 12:24:40 -0500
commit79ecff700d3f12bcdfcdc2e9aa52d7082ef4a3ab (patch)
tree7804d927620806703901c2e6c2452986dc6fc537 /src/os/linux
parent55f89def93253cc9a34396c03f4a1ea1484ab9f1 (diff)
parentb0d5c99878ddcade4f60f233432033563e4fb2d9 (diff)
Merge
Diffstat (limited to 'src/os/linux')
-rw-r--r--src/os/linux/vm/os_linux.cpp10
-rw-r--r--src/os/linux/vm/os_linux.inline.hpp11
-rw-r--r--src/os/linux/vm/vmError_linux.cpp4
3 files changed, 12 insertions, 13 deletions
diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp
index 8700d10be..330e347a7 100644
--- a/src/os/linux/vm/os_linux.cpp
+++ b/src/os/linux/vm/os_linux.cpp
@@ -115,6 +115,7 @@
# include <link.h>
# include <stdint.h>
# include <inttypes.h>
+# include <sys/ioctl.h>
#define MAX_PATH (2 * K)
@@ -4433,6 +4434,15 @@ int os::available(int fd, jlong *bytes) {
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 --git a/src/os/linux/vm/os_linux.inline.hpp b/src/os/linux/vm/os_linux.inline.hpp
index 6e52d108f..9af7e7897 100644
--- a/src/os/linux/vm/os_linux.inline.hpp
+++ b/src/os/linux/vm/os_linux.inline.hpp
@@ -45,7 +45,6 @@
#include <unistd.h>
#include <sys/socket.h>
#include <sys/poll.h>
-#include <sys/ioctl.h>
#include <netdb.h>
inline void* os::thread_local_storage_at(int index) {
@@ -268,16 +267,6 @@ inline int os::sendto(int fd, char *buf, int len, int flags,
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);
}
diff --git a/src/os/linux/vm/vmError_linux.cpp b/src/os/linux/vm/vmError_linux.cpp
index 578ef7c86..8ec6ca04c 100644
--- a/src/os/linux/vm/vmError_linux.cpp
+++ b/src/os/linux/vm/vmError_linux.cpp
@@ -44,11 +44,11 @@ void VMError::show_message_box(char *buf, int buflen) {
jio_snprintf(p, buflen - len,
"\n\n"
"Do you want to debug the problem?\n\n"
- "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " INTX_FORMAT "\n"
+ "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " INTX_FORMAT " (" INTPTR_FORMAT ")\n"
"Enter 'yes' to launch gdb automatically (PATH must include gdb)\n"
"Otherwise, press RETURN to abort...",
os::current_process_id(), os::current_process_id(),
- os::current_thread_id());
+ os::current_thread_id(), os::current_thread_id());
yes = os::message_box("Unexpected Error", buf);