author | aeriksso |
Tue, 19 Jan 2016 10:02:22 +0100 | |
changeset 35528 | f8a8d6664a19 |
parent 35479 | 62c12ca7a45e |
child 39390 | edf6a424a8b7 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
35479
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
33632
diff
changeset
|
2 |
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
670
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
670
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
670
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP |
26 |
#define OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP |
|
27 |
||
28 |
#include "runtime/os.hpp" |
|
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
13963
diff
changeset
|
29 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
30 |
// System includes |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
31 |
#include <sys/param.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
32 |
#include <dlfcn.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
33 |
#include <sys/socket.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
34 |
#include <sys/poll.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
35 |
#include <sys/filio.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
36 |
#include <unistd.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
37 |
#include <netdb.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
38 |
#include <setjmp.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
39 |
|
1 | 40 |
// File names are case-sensitive on windows only |
41 |
inline int os::file_name_strcmp(const char* s1, const char* s2) { |
|
42 |
return strcmp(s1, s2); |
|
43 |
} |
|
44 |
||
45 |
inline bool os::uses_stack_guard_pages() { |
|
46 |
return true; |
|
47 |
} |
|
48 |
||
49 |
inline bool os::allocate_stack_guard_pages() { |
|
50 |
assert(uses_stack_guard_pages(), "sanity check"); |
|
51 |
int r = thr_main() ; |
|
52 |
guarantee (r == 0 || r == 1, "CR6501650 or CR6493689") ; |
|
53 |
return r; |
|
54 |
} |
|
55 |
||
56 |
||
57 |
// On Solaris, reservations are made on a page by page basis, nothing to do. |
|
13195 | 58 |
inline void os::pd_split_reserved_memory(char *base, size_t size, |
1 | 59 |
size_t split, bool realloc) { |
60 |
} |
|
61 |
||
62 |
||
63 |
// Bang the shadow pages if they need to be touched to be mapped. |
|
35479
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
33632
diff
changeset
|
64 |
inline void os::map_stack_shadow_pages() { |
1 | 65 |
} |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
66 |
inline void os::dll_unload(void *lib) { ::dlclose(lib); } |
1 | 67 |
|
33632 | 68 |
inline const int os::default_file_open_flags() { return 0;} |
69 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
70 |
inline DIR* os::opendir(const char* dirname) { |
1 | 71 |
assert(dirname != NULL, "just checking"); |
72 |
return ::opendir(dirname); |
|
73 |
} |
|
74 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
75 |
inline int os::readdir_buf_size(const char *path) { |
1 | 76 |
int size = pathconf(path, _PC_NAME_MAX); |
77 |
return (size < 0 ? MAXPATHLEN : size) + sizeof(dirent) + 1; |
|
78 |
} |
|
79 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
80 |
inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) { |
1 | 81 |
assert(dirp != NULL, "just checking"); |
18441 | 82 |
#if defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 |
1 | 83 |
dirent* p; |
84 |
int status; |
|
85 |
||
86 |
if((status = ::readdir_r(dirp, dbuf, &p)) != 0) { |
|
87 |
errno = status; |
|
88 |
return NULL; |
|
89 |
} else |
|
90 |
return p; |
|
18441 | 91 |
#else // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 |
1 | 92 |
return ::readdir_r(dirp, dbuf); |
18441 | 93 |
#endif // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 |
1 | 94 |
} |
95 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
96 |
inline int os::closedir(DIR *dirp) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
97 |
assert(dirp != NULL, "argument is NULL"); |
1 | 98 |
return ::closedir(dirp); |
99 |
} |
|
100 |
||
101 |
////////////////////////////////////////////////////////////////////////////// |
|
102 |
//////////////////////////////////////////////////////////////////////////////// |
|
103 |
||
23443
15e8ed68f73a
8036128: Remove deprecated VM flag UseVMInterruptibleIO
fparain
parents:
22891
diff
changeset
|
104 |
// macros for restartable system calls |
1 | 105 |
|
106 |
#define RESTARTABLE(_cmd, _result) do { \ |
|
107 |
do { \ |
|
108 |
_result = _cmd; \ |
|
109 |
} while((_result == OS_ERR) && (errno == EINTR)); \ |
|
110 |
} while(false) |
|
111 |
||
112 |
#define RESTARTABLE_RETURN_INT(_cmd) do { \ |
|
113 |
int _result; \ |
|
114 |
RESTARTABLE(_cmd, _result); \ |
|
115 |
return _result; \ |
|
116 |
} while(false) |
|
388 | 117 |
|
118 |
inline bool os::numa_has_static_binding() { return false; } |
|
119 |
inline bool os::numa_has_group_homing() { return true; } |
|
7397 | 120 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
121 |
inline int os::socket(int domain, int type, int protocol) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
122 |
return ::socket(domain, type, protocol); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
123 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
124 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
7405
diff
changeset
|
125 |
inline struct hostent* os::get_host_by_name(char* name) { |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
126 |
return ::gethostbyname(name); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
127 |
} |
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
7405
diff
changeset
|
128 |
|
22891
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18441
diff
changeset
|
129 |
inline bool os::supports_monotonic_clock() { |
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18441
diff
changeset
|
130 |
// javaTimeNanos() is monotonic on Solaris, see getTimeNanos() comments |
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18441
diff
changeset
|
131 |
return true; |
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18441
diff
changeset
|
132 |
} |
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18441
diff
changeset
|
133 |
|
26682
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
134 |
inline void os::exit(int num) { |
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
135 |
::exit(num); |
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
136 |
} |
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
137 |
|
7397 | 138 |
#endif // OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP |