comparison src/os/solaris/vm/os_solaris.inline.hpp @ 1980:828eafbd85cc

6348631: remove the use of the HPI library from Hotspot Summary: move functions from hpi library to hotspot, communicate with licensees and open source community, check jdk for dependency, file CCC request Reviewed-by: coleenp, acorn, dsamersoff
author ikrylov
date Wed, 01 Dec 2010 18:26:32 -0500
parents f95d63e2154a
children 11c26bfcf8c7
comparison
equal deleted inserted replaced
1972:f95d63e2154a 1980:828eafbd85cc
34 #ifdef TARGET_OS_ARCH_solaris_sparc 34 #ifdef TARGET_OS_ARCH_solaris_sparc
35 # include "atomic_solaris_sparc.inline.hpp" 35 # include "atomic_solaris_sparc.inline.hpp"
36 # include "orderAccess_solaris_sparc.inline.hpp" 36 # include "orderAccess_solaris_sparc.inline.hpp"
37 #endif 37 #endif
38 38
39 // System includes
40 #include <sys/param.h>
41 #include <dlfcn.h>
42 #include <sys/socket.h>
43 #include <sys/poll.h>
44 #include <sys/filio.h>
45 #include <unistd.h>
46 #include <netdb.h>
47 #include <setjmp.h>
48
39 inline const char* os::file_separator() { return "/"; } 49 inline const char* os::file_separator() { return "/"; }
40 inline const char* os::line_separator() { return "\n"; } 50 inline const char* os::line_separator() { return "\n"; }
41 inline const char* os::path_separator() { return ":"; } 51 inline const char* os::path_separator() { return ":"; }
42 52
43 inline const char* os::jlong_format_specifier() { return "%lld"; } 53 inline const char* os::jlong_format_specifier() { return "%lld"; }
67 77
68 78
69 // Bang the shadow pages if they need to be touched to be mapped. 79 // Bang the shadow pages if they need to be touched to be mapped.
70 inline void os::bang_stack_shadow_pages() { 80 inline void os::bang_stack_shadow_pages() {
71 } 81 }
72 82 inline void os::dll_unload(void *lib) { ::dlclose(lib); }
73 inline DIR* os::opendir(const char* dirname) 83
74 { 84 inline DIR* os::opendir(const char* dirname) {
75 assert(dirname != NULL, "just checking"); 85 assert(dirname != NULL, "just checking");
76 return ::opendir(dirname); 86 return ::opendir(dirname);
77 } 87 }
78 88
79 inline int os::readdir_buf_size(const char *path) 89 inline int os::readdir_buf_size(const char *path) {
80 {
81 int size = pathconf(path, _PC_NAME_MAX); 90 int size = pathconf(path, _PC_NAME_MAX);
82 return (size < 0 ? MAXPATHLEN : size) + sizeof(dirent) + 1; 91 return (size < 0 ? MAXPATHLEN : size) + sizeof(dirent) + 1;
83 } 92 }
84 93
85 inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) 94 inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) {
86 {
87 assert(dirp != NULL, "just checking"); 95 assert(dirp != NULL, "just checking");
88 #if defined(_LP64) || defined(_GNU_SOURCE) 96 #if defined(_LP64) || defined(_GNU_SOURCE)
89 dirent* p; 97 dirent* p;
90 int status; 98 int status;
91 99
97 #else // defined(_LP64) || defined(_GNU_SOURCE) 105 #else // defined(_LP64) || defined(_GNU_SOURCE)
98 return ::readdir_r(dirp, dbuf); 106 return ::readdir_r(dirp, dbuf);
99 #endif // defined(_LP64) || defined(_GNU_SOURCE) 107 #endif // defined(_LP64) || defined(_GNU_SOURCE)
100 } 108 }
101 109
102 inline int os::closedir(DIR *dirp) 110 inline int os::closedir(DIR *dirp) {
103 { 111 assert(dirp != NULL, "argument is NULL");
104 assert(dirp != NULL, "just checking");
105 return ::closedir(dirp); 112 return ::closedir(dirp);
106 } 113 }
107 114
108 ////////////////////////////////////////////////////////////////////////////// 115 //////////////////////////////////////////////////////////////////////////////
109 //////////////////////////////////////////////////////////////////////////////// 116 ////////////////////////////////////////////////////////////////////////////////
220 } while(false) 227 } while(false)
221 228
222 inline bool os::numa_has_static_binding() { return false; } 229 inline bool os::numa_has_static_binding() { return false; }
223 inline bool os::numa_has_group_homing() { return true; } 230 inline bool os::numa_has_group_homing() { return true; }
224 231
232 inline int os::socket(int domain, int type, int protocol) {
233 return ::socket(domain, type, protocol);
234 }
235
236 inline int os::listen(int fd, int count) {
237 if (fd < 0) return OS_ERR;
238
239 return ::listen(fd, count);
240 }
241
242 inline int os::socket_shutdown(int fd, int howto){
243 return ::shutdown(fd, howto);
244 }
245
246 inline int os::get_sock_name(int fd, struct sockaddr *him, int *len){
247 return ::getsockname(fd, him, (socklen_t*) len);
248 }
249
250 inline int os::get_host_name(char* name, int namelen){
251 return ::gethostname(name, namelen);
252 }
253
254 inline struct hostent* os::get_host_by_name(char* name) {
255 return ::gethostbyname(name);
256 }
257 inline int os::get_sock_opt(int fd, int level, int optname,
258 char *optval, int* optlen){
259 return ::getsockopt(fd, level, optname, optval, (socklen_t*) optlen);
260 }
261
262 inline int os::set_sock_opt(int fd, int level, int optname,
263 const char *optval, int optlen){
264 return ::setsockopt(fd, level, optname, optval, optlen);
265 }
225 #endif // OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP 266 #endif // OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP