author | serb |
Wed, 04 Jun 2014 16:55:06 +0400 | |
changeset 25127 | e92fa066b0e0 |
parent 24351 | 61b33cc6d3cf |
child 25468 | 5331df506290 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
22891
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18025
diff
changeset
|
2 |
* Copyright (c) 1999, 2014, 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_LINUX_VM_OS_LINUX_INLINE_HPP |
26 |
#define OS_LINUX_VM_OS_LINUX_INLINE_HPP |
|
27 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
13963
diff
changeset
|
28 |
#include "runtime/atomic.inline.hpp" |
24351
61b33cc6d3cf
8042195: Introduce umbrella header orderAccess.inline.hpp.
goetz
parents:
22891
diff
changeset
|
29 |
#include "runtime/orderAccess.inline.hpp" |
7397 | 30 |
#include "runtime/os.hpp" |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
13963
diff
changeset
|
31 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
32 |
// System includes |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
33 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
34 |
#include <unistd.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
35 |
#include <sys/socket.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
36 |
#include <sys/poll.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 |
|
1 | 39 |
inline void* os::thread_local_storage_at(int index) { |
40 |
return pthread_getspecific((pthread_key_t)index); |
|
41 |
} |
|
42 |
||
43 |
inline const char* os::file_separator() { |
|
44 |
return "/"; |
|
45 |
} |
|
46 |
||
47 |
inline const char* os::line_separator() { |
|
48 |
return "\n"; |
|
49 |
} |
|
50 |
||
51 |
inline const char* os::path_separator() { |
|
52 |
return ":"; |
|
53 |
} |
|
54 |
||
55 |
// File names are case-sensitive on windows only |
|
56 |
inline int os::file_name_strcmp(const char* s1, const char* s2) { |
|
57 |
return strcmp(s1, s2); |
|
58 |
} |
|
59 |
||
60 |
inline bool os::obsolete_option(const JavaVMOption *option) { |
|
61 |
return false; |
|
62 |
} |
|
63 |
||
64 |
inline bool os::uses_stack_guard_pages() { |
|
65 |
return true; |
|
66 |
} |
|
67 |
||
68 |
inline bool os::allocate_stack_guard_pages() { |
|
69 |
assert(uses_stack_guard_pages(), "sanity check"); |
|
70 |
return true; |
|
71 |
} |
|
72 |
||
73 |
||
74 |
// On Linux, reservations are made on a page by page basis, nothing to do. |
|
13195 | 75 |
inline void os::pd_split_reserved_memory(char *base, size_t size, |
1 | 76 |
size_t split, bool realloc) { |
77 |
} |
|
78 |
||
79 |
||
80 |
// Bang the shadow pages if they need to be touched to be mapped. |
|
81 |
inline void os::bang_stack_shadow_pages() { |
|
82 |
} |
|
83 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
84 |
inline void os::dll_unload(void *lib) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
85 |
::dlclose(lib); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
86 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
87 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
88 |
inline const int os::default_file_open_flags() { return 0;} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
89 |
|
1 | 90 |
inline DIR* os::opendir(const char* dirname) |
91 |
{ |
|
92 |
assert(dirname != NULL, "just checking"); |
|
93 |
return ::opendir(dirname); |
|
94 |
} |
|
95 |
||
96 |
inline int os::readdir_buf_size(const char *path) |
|
97 |
{ |
|
98 |
return NAME_MAX + sizeof(dirent) + 1; |
|
99 |
} |
|
100 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
101 |
inline jlong os::lseek(int fd, jlong offset, int whence) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
102 |
return (jlong) ::lseek64(fd, offset, whence); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
103 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
104 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
105 |
inline int os::fsync(int fd) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
106 |
return ::fsync(fd); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
107 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
108 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
109 |
inline char* os::native_path(char *path) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
110 |
return path; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
111 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
112 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
113 |
inline int os::ftruncate(int fd, jlong length) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
114 |
return ::ftruncate64(fd, length); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
115 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
116 |
|
1 | 117 |
inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) |
118 |
{ |
|
119 |
dirent* p; |
|
120 |
int status; |
|
121 |
assert(dirp != NULL, "just checking"); |
|
122 |
||
123 |
// NOTE: Linux readdir_r (on RH 6.2 and 7.2 at least) is NOT like the POSIX |
|
124 |
// version. Here is the doc for this function: |
|
125 |
// http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_262.html |
|
126 |
||
127 |
if((status = ::readdir_r(dirp, dbuf, &p)) != 0) { |
|
128 |
errno = status; |
|
129 |
return NULL; |
|
130 |
} else |
|
131 |
return p; |
|
132 |
} |
|
133 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
134 |
inline int os::closedir(DIR *dirp) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
135 |
assert(dirp != NULL, "argument is NULL"); |
1 | 136 |
return ::closedir(dirp); |
137 |
} |
|
138 |
||
139 |
// macros for restartable system calls |
|
140 |
||
141 |
#define RESTARTABLE(_cmd, _result) do { \ |
|
142 |
_result = _cmd; \ |
|
143 |
} while(((int)_result == OS_ERR) && (errno == EINTR)) |
|
144 |
||
145 |
#define RESTARTABLE_RETURN_INT(_cmd) do { \ |
|
146 |
int _result; \ |
|
147 |
RESTARTABLE(_cmd, _result); \ |
|
148 |
return _result; \ |
|
149 |
} while(false) |
|
388 | 150 |
|
151 |
inline bool os::numa_has_static_binding() { return true; } |
|
152 |
inline bool os::numa_has_group_homing() { return false; } |
|
7397 | 153 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
154 |
inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
155 |
size_t res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
156 |
RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
157 |
return res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
158 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
159 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
160 |
inline size_t os::write(int fd, const void *buf, unsigned int nBytes) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
161 |
size_t res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
162 |
RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
163 |
return res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
164 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
165 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
166 |
inline int os::close(int fd) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
167 |
return ::close(fd); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
168 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
169 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
170 |
inline int os::socket_close(int fd) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
171 |
return ::close(fd); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
172 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
173 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
174 |
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
|
175 |
return ::socket(domain, type, protocol); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
176 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
177 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
178 |
inline int os::recv(int fd, char* buf, size_t nBytes, uint flags) { |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
179 |
RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, flags)); |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
180 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
181 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
182 |
inline int os::send(int fd, char* buf, size_t nBytes, uint flags) { |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
183 |
RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags)); |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
184 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
185 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
186 |
inline int os::raw_send(int fd, char* buf, size_t nBytes, uint flags) { |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
187 |
return os::send(fd, buf, nBytes, flags); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
188 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
189 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
190 |
inline int os::timeout(int fd, long timeout) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
191 |
julong prevtime,newtime; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
192 |
struct timeval t; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
193 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
194 |
gettimeofday(&t, NULL); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
195 |
prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
196 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
197 |
for(;;) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
198 |
struct pollfd pfd; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
199 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
200 |
pfd.fd = fd; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
201 |
pfd.events = POLLIN | POLLERR; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
202 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
203 |
int res = ::poll(&pfd, 1, timeout); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
204 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
205 |
if (res == OS_ERR && errno == EINTR) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
206 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
207 |
// On Linux any value < 0 means "forever" |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
208 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
209 |
if(timeout >= 0) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
210 |
gettimeofday(&t, NULL); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
211 |
newtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
212 |
timeout -= newtime - prevtime; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
213 |
if(timeout <= 0) |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
214 |
return OS_OK; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
215 |
prevtime = newtime; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
216 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
217 |
} else |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
218 |
return res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
219 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
220 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
221 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
222 |
inline int os::listen(int fd, int count) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
223 |
return ::listen(fd, count); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
224 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
225 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
226 |
inline int os::connect(int fd, struct sockaddr* him, socklen_t len) { |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
227 |
RESTARTABLE_RETURN_INT(::connect(fd, him, len)); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
228 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
229 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
230 |
inline int os::accept(int fd, struct sockaddr* him, socklen_t* len) { |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
231 |
// Linux doc says this can't return EINTR, unlike accept() on Solaris. |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
232 |
// But see attachListener_linux.cpp, LinuxAttachListener::dequeue(). |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
233 |
return (int)::accept(fd, him, len); |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
234 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
235 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
236 |
inline int os::recvfrom(int fd, char* buf, size_t nBytes, uint flags, |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
237 |
sockaddr* from, socklen_t* fromlen) { |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
238 |
RESTARTABLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes, flags, from, fromlen)); |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
239 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
240 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
241 |
inline int os::sendto(int fd, char* buf, size_t len, uint flags, |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
242 |
struct sockaddr* to, socklen_t tolen) { |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
243 |
RESTARTABLE_RETURN_INT((int)::sendto(fd, buf, len, flags, to, tolen)); |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
244 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
245 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
246 |
inline int os::socket_shutdown(int fd, int howto) { |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
247 |
return ::shutdown(fd, howto); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
248 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
249 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
250 |
inline int os::bind(int fd, struct sockaddr* him, socklen_t len) { |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
251 |
return ::bind(fd, him, len); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
252 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
253 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
254 |
inline int os::get_sock_name(int fd, struct sockaddr* him, socklen_t* len) { |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
255 |
return ::getsockname(fd, him, len); |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
256 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
257 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
258 |
inline int os::get_host_name(char* name, int namelen) { |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
259 |
return ::gethostname(name, namelen); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
260 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
261 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
262 |
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
|
263 |
return ::gethostbyname(name); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
264 |
} |
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
265 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
266 |
inline int os::get_sock_opt(int fd, int level, int optname, |
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
267 |
char* optval, socklen_t* optlen) { |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
268 |
return ::getsockopt(fd, level, optname, optval, optlen); |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
269 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
270 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
271 |
inline int os::set_sock_opt(int fd, int level, int optname, |
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
272 |
const char* optval, socklen_t optlen) { |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
273 |
return ::setsockopt(fd, level, optname, optval, optlen); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
274 |
} |
15855
2ac9ebea17f3
8008959: Fix non-PCH build on Linux, Windows and MacOS X
simonis
parents:
15228
diff
changeset
|
275 |
|
22891
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18025
diff
changeset
|
276 |
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:
18025
diff
changeset
|
277 |
return Linux::_clock_gettime != NULL; |
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18025
diff
changeset
|
278 |
} |
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18025
diff
changeset
|
279 |
|
7397 | 280 |
#endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP |