Mercurial > hg > graal-jvmci-8
comparison src/os/linux/vm/os_linux.cpp @ 2033:03e1b9fce89d
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
author | dholmes |
---|---|
date | Thu, 16 Dec 2010 20:57:03 -0500 |
parents | 54f5dd2aa1d9 |
children | 06f017f7daa7 34d64ad817f4 |
comparison
equal
deleted
inserted
replaced
2032:320ef6401fce | 2033:03e1b9fce89d |
---|---|
113 # include <sys/ipc.h> | 113 # include <sys/ipc.h> |
114 # include <sys/shm.h> | 114 # include <sys/shm.h> |
115 # include <link.h> | 115 # include <link.h> |
116 # include <stdint.h> | 116 # include <stdint.h> |
117 # include <inttypes.h> | 117 # include <inttypes.h> |
118 # include <sys/ioctl.h> | |
118 | 119 |
119 #define MAX_PATH (2 * K) | 120 #define MAX_PATH (2 * K) |
120 | 121 |
121 // for timer info max values which include all bits | 122 // for timer info max values which include all bits |
122 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF) | 123 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF) |
4429 } else if (::lseek64(fd, cur, SEEK_SET) == -1) { | 4430 } else if (::lseek64(fd, cur, SEEK_SET) == -1) { |
4430 return 0; | 4431 return 0; |
4431 } | 4432 } |
4432 *bytes = end - cur; | 4433 *bytes = end - cur; |
4433 return 1; | 4434 return 1; |
4435 } | |
4436 | |
4437 int os::socket_available(int fd, jint *pbytes) { | |
4438 // Linux doc says EINTR not returned, unlike Solaris | |
4439 int ret = ::ioctl(fd, FIONREAD, pbytes); | |
4440 | |
4441 //%% note ioctl can return 0 when successful, JVM_SocketAvailable | |
4442 // is expected to return 0 on failure and 1 on success to the jdk. | |
4443 return (ret < 0) ? 0 : 1; | |
4434 } | 4444 } |
4435 | 4445 |
4436 // Map a block of memory. | 4446 // Map a block of memory. |
4437 char* os::map_memory(int fd, const char* file_name, size_t file_offset, | 4447 char* os::map_memory(int fd, const char* file_name, size_t file_offset, |
4438 char *addr, size_t bytes, bool read_only, | 4448 char *addr, size_t bytes, bool read_only, |