author | phh |
Wed, 21 Dec 2011 15:48:16 -0500 | |
changeset 11256 | 025cd1741566 |
parent 8921 | 14bfe81f2a9d |
child 13195 | be27e1b6a4b9 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
8921
14bfe81f2a9d
7010070: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - second pass
trims
parents:
8107
diff
changeset
|
2 |
* Copyright (c) 1999, 2011, 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 |
||
28 |
#include "runtime/atomic.hpp" |
|
29 |
#include "runtime/os.hpp" |
|
30 |
#ifdef TARGET_OS_ARCH_linux_x86 |
|
31 |
# include "atomic_linux_x86.inline.hpp" |
|
32 |
# include "orderAccess_linux_x86.inline.hpp" |
|
33 |
#endif |
|
34 |
#ifdef TARGET_OS_ARCH_linux_sparc |
|
35 |
# include "atomic_linux_sparc.inline.hpp" |
|
36 |
# include "orderAccess_linux_sparc.inline.hpp" |
|
37 |
#endif |
|
38 |
#ifdef TARGET_OS_ARCH_linux_zero |
|
39 |
# include "atomic_linux_zero.inline.hpp" |
|
40 |
# include "orderAccess_linux_zero.inline.hpp" |
|
41 |
#endif |
|
8107
78e5bd944384
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
7458
diff
changeset
|
42 |
#ifdef TARGET_OS_ARCH_linux_arm |
78e5bd944384
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
7458
diff
changeset
|
43 |
# include "atomic_linux_arm.inline.hpp" |
78e5bd944384
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
7458
diff
changeset
|
44 |
# include "orderAccess_linux_arm.inline.hpp" |
78e5bd944384
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
7458
diff
changeset
|
45 |
#endif |
78e5bd944384
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
7458
diff
changeset
|
46 |
#ifdef TARGET_OS_ARCH_linux_ppc |
78e5bd944384
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
7458
diff
changeset
|
47 |
# include "atomic_linux_ppc.inline.hpp" |
78e5bd944384
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
7458
diff
changeset
|
48 |
# include "orderAccess_linux_ppc.inline.hpp" |
78e5bd944384
7016023: Enable building ARM and PPC from src/closed repository
bobv
parents:
7458
diff
changeset
|
49 |
#endif |
7397 | 50 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
51 |
// System includes |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
52 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
53 |
#include <unistd.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
54 |
#include <sys/socket.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
55 |
#include <sys/poll.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
56 |
#include <netdb.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
57 |
|
1 | 58 |
inline void* os::thread_local_storage_at(int index) { |
59 |
return pthread_getspecific((pthread_key_t)index); |
|
60 |
} |
|
61 |
||
62 |
inline const char* os::file_separator() { |
|
63 |
return "/"; |
|
64 |
} |
|
65 |
||
66 |
inline const char* os::line_separator() { |
|
67 |
return "\n"; |
|
68 |
} |
|
69 |
||
70 |
inline const char* os::path_separator() { |
|
71 |
return ":"; |
|
72 |
} |
|
73 |
||
74 |
inline const char* os::jlong_format_specifier() { |
|
75 |
return "%lld"; |
|
76 |
} |
|
77 |
||
78 |
inline const char* os::julong_format_specifier() { |
|
79 |
return "%llu"; |
|
80 |
} |
|
81 |
||
82 |
// File names are case-sensitive on windows only |
|
83 |
inline int os::file_name_strcmp(const char* s1, const char* s2) { |
|
84 |
return strcmp(s1, s2); |
|
85 |
} |
|
86 |
||
87 |
inline bool os::obsolete_option(const JavaVMOption *option) { |
|
88 |
return false; |
|
89 |
} |
|
90 |
||
91 |
inline bool os::uses_stack_guard_pages() { |
|
92 |
return true; |
|
93 |
} |
|
94 |
||
95 |
inline bool os::allocate_stack_guard_pages() { |
|
96 |
assert(uses_stack_guard_pages(), "sanity check"); |
|
97 |
return true; |
|
98 |
} |
|
99 |
||
100 |
||
101 |
// On Linux, reservations are made on a page by page basis, nothing to do. |
|
102 |
inline void os::split_reserved_memory(char *base, size_t size, |
|
103 |
size_t split, bool realloc) { |
|
104 |
} |
|
105 |
||
106 |
||
107 |
// Bang the shadow pages if they need to be touched to be mapped. |
|
108 |
inline void os::bang_stack_shadow_pages() { |
|
109 |
} |
|
110 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
111 |
inline void os::dll_unload(void *lib) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
112 |
::dlclose(lib); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
113 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
114 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
115 |
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
|
116 |
|
1 | 117 |
inline DIR* os::opendir(const char* dirname) |
118 |
{ |
|
119 |
assert(dirname != NULL, "just checking"); |
|
120 |
return ::opendir(dirname); |
|
121 |
} |
|
122 |
||
123 |
inline int os::readdir_buf_size(const char *path) |
|
124 |
{ |
|
125 |
return NAME_MAX + sizeof(dirent) + 1; |
|
126 |
} |
|
127 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
128 |
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
|
129 |
return (jlong) ::lseek64(fd, offset, whence); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
130 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
131 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
132 |
inline int os::fsync(int fd) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
133 |
return ::fsync(fd); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
134 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
135 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
136 |
inline char* os::native_path(char *path) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
137 |
return path; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
138 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
139 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
140 |
inline int os::ftruncate(int fd, jlong length) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
141 |
return ::ftruncate64(fd, length); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
142 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
143 |
|
1 | 144 |
inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) |
145 |
{ |
|
146 |
dirent* p; |
|
147 |
int status; |
|
148 |
assert(dirp != NULL, "just checking"); |
|
149 |
||
150 |
// NOTE: Linux readdir_r (on RH 6.2 and 7.2 at least) is NOT like the POSIX |
|
151 |
// version. Here is the doc for this function: |
|
152 |
// http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_262.html |
|
153 |
||
154 |
if((status = ::readdir_r(dirp, dbuf, &p)) != 0) { |
|
155 |
errno = status; |
|
156 |
return NULL; |
|
157 |
} else |
|
158 |
return p; |
|
159 |
} |
|
160 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
161 |
inline int os::closedir(DIR *dirp) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
162 |
assert(dirp != NULL, "argument is NULL"); |
1 | 163 |
return ::closedir(dirp); |
164 |
} |
|
165 |
||
166 |
// macros for restartable system calls |
|
167 |
||
168 |
#define RESTARTABLE(_cmd, _result) do { \ |
|
169 |
_result = _cmd; \ |
|
170 |
} while(((int)_result == OS_ERR) && (errno == EINTR)) |
|
171 |
||
172 |
#define RESTARTABLE_RETURN_INT(_cmd) do { \ |
|
173 |
int _result; \ |
|
174 |
RESTARTABLE(_cmd, _result); \ |
|
175 |
return _result; \ |
|
176 |
} while(false) |
|
388 | 177 |
|
178 |
inline bool os::numa_has_static_binding() { return true; } |
|
179 |
inline bool os::numa_has_group_homing() { return false; } |
|
7397 | 180 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
181 |
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
|
182 |
size_t res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
183 |
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
|
184 |
return res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
185 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
186 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
187 |
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
|
188 |
size_t res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
189 |
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
|
190 |
return res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
191 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
192 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
193 |
inline int os::close(int fd) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
194 |
return ::close(fd); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
195 |
} |
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 |
inline int os::socket_close(int fd) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
198 |
return ::close(fd); |
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 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
201 |
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
|
202 |
return ::socket(domain, type, protocol); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
203 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
204 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
205 |
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
|
206 |
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
|
207 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
208 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
209 |
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
|
210 |
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
|
211 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
212 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
213 |
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
|
214 |
return os::send(fd, buf, nBytes, flags); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
215 |
} |
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 |
inline int os::timeout(int fd, long timeout) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
218 |
julong prevtime,newtime; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
219 |
struct timeval t; |
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 |
gettimeofday(&t, NULL); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
222 |
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
|
223 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
224 |
for(;;) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
225 |
struct pollfd pfd; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
226 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
227 |
pfd.fd = fd; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
228 |
pfd.events = POLLIN | POLLERR; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
229 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
230 |
int res = ::poll(&pfd, 1, timeout); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
231 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
232 |
if (res == OS_ERR && errno == EINTR) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
233 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
234 |
// On Linux any value < 0 means "forever" |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
235 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
236 |
if(timeout >= 0) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
237 |
gettimeofday(&t, NULL); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
238 |
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
|
239 |
timeout -= newtime - prevtime; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
240 |
if(timeout <= 0) |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
241 |
return OS_OK; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
242 |
prevtime = newtime; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
243 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
244 |
} else |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
245 |
return res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
246 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
247 |
} |
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 |
inline int os::listen(int fd, int count) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
250 |
return ::listen(fd, count); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
251 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
252 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
253 |
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
|
254 |
RESTARTABLE_RETURN_INT(::connect(fd, him, len)); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
255 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
256 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
257 |
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
|
258 |
// 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
|
259 |
// But see attachListener_linux.cpp, LinuxAttachListener::dequeue(). |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
260 |
return (int)::accept(fd, him, len); |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
261 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
262 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
263 |
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
|
264 |
sockaddr* from, socklen_t* fromlen) { |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
265 |
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
|
266 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
267 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
268 |
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
|
269 |
struct sockaddr* to, socklen_t tolen) { |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
270 |
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
|
271 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
272 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
273 |
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
|
274 |
return ::shutdown(fd, howto); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
275 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
276 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
277 |
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
|
278 |
return ::bind(fd, him, len); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
279 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
280 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
281 |
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
|
282 |
return ::getsockname(fd, him, len); |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
283 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
284 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
285 |
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
|
286 |
return ::gethostname(name, namelen); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
287 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
288 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
289 |
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
|
290 |
return ::gethostbyname(name); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
291 |
} |
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
292 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
293 |
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
|
294 |
char* optval, socklen_t* optlen) { |
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
295 |
return ::getsockopt(fd, level, optname, optval, optlen); |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
296 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
297 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
298 |
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
|
299 |
const char* optval, socklen_t optlen) { |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
300 |
return ::setsockopt(fd, level, optname, optval, optlen); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
301 |
} |
7397 | 302 |
#endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP |