Mercurial > hg > graal-compiler
annotate src/os/linux/vm/os_linux.inline.hpp @ 21353:876e710523c5
Truffle/Instrumentation: rename "Tool Eval" Instrument kind to "Advanced" Instrument kind
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Tue, 12 May 2015 12:57:47 -0700 |
parents | 7848fc12602b |
children |
rev | line source |
---|---|
0 | 1 /* |
7623
203f64878aab
7102489: RFE: cleanup jlong typedef on __APPLE__and _LLP64 systems.
hseigel
parents:
7199
diff
changeset
|
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
196
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
196
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
196
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef OS_LINUX_VM_OS_LINUX_INLINE_HPP |
26 #define OS_LINUX_VM_OS_LINUX_INLINE_HPP | |
27 | |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
6842
diff
changeset
|
28 #include "runtime/atomic.inline.hpp" |
20197
ce8f6bb717c9
8042195: Introduce umbrella header orderAccess.inline.hpp.
goetz
parents:
10405
diff
changeset
|
29 #include "runtime/orderAccess.inline.hpp" |
1972 | 30 #include "runtime/os.hpp" |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
6842
diff
changeset
|
31 |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
32 // System includes |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
33 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
34 #include <unistd.h> |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
35 #include <sys/socket.h> |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
36 #include <sys/poll.h> |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
37 #include <netdb.h> |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
38 |
0 | 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. | |
6197 | 75 inline void os::pd_split_reserved_memory(char *base, size_t size, |
0 | 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 | |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
84 inline void os::dll_unload(void *lib) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
85 ::dlclose(lib); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
86 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
87 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
88 inline const int os::default_file_open_flags() { return 0;} |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
89 |
0 | 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 | |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
101 inline jlong os::lseek(int fd, jlong offset, int whence) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
102 return (jlong) ::lseek64(fd, offset, whence); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
103 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
104 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
105 inline int os::fsync(int fd) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
106 return ::fsync(fd); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
107 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
108 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
109 inline char* os::native_path(char *path) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
110 return path; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
111 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
112 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
113 inline int os::ftruncate(int fd, jlong length) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
114 return ::ftruncate64(fd, length); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
115 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
116 |
0 | 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 | |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
134 inline int os::closedir(DIR *dirp) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
135 assert(dirp != NULL, "argument is NULL"); |
0 | 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) | |
141 | 150 |
151 inline bool os::numa_has_static_binding() { return true; } | |
152 inline bool os::numa_has_group_homing() { return false; } | |
1972 | 153 |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
154 inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
155 size_t res; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
156 RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
157 return res; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
158 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
159 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
160 inline size_t os::write(int fd, const void *buf, unsigned int nBytes) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
161 size_t res; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
162 RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
163 return res; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
164 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
165 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
166 inline int os::close(int fd) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
167 return ::close(fd); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
168 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
169 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
170 inline int os::socket_close(int fd) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
171 return ::close(fd); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
172 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
173 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
174 inline int os::socket(int domain, int type, int protocol) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
175 return ::socket(domain, type, protocol); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
176 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
177 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
178 inline int os::recv(int fd, char* buf, size_t nBytes, uint flags) { |
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
179 RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, flags)); |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
180 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
181 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
182 inline int os::send(int fd, char* buf, size_t nBytes, uint flags) { |
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
183 RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags)); |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
184 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
185 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
186 inline int os::raw_send(int fd, char* buf, size_t nBytes, uint flags) { |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
187 return os::send(fd, buf, nBytes, flags); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
188 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
189 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
190 inline int os::timeout(int fd, long timeout) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
191 julong prevtime,newtime; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
192 struct timeval t; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
193 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
194 gettimeofday(&t, NULL); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
195 prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
196 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
197 for(;;) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
198 struct pollfd pfd; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
199 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
200 pfd.fd = fd; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
201 pfd.events = POLLIN | POLLERR; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
202 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
203 int res = ::poll(&pfd, 1, timeout); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
204 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
205 if (res == OS_ERR && errno == EINTR) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
206 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
207 // On Linux any value < 0 means "forever" |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
208 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
209 if(timeout >= 0) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
210 gettimeofday(&t, NULL); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
211 newtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
212 timeout -= newtime - prevtime; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
213 if(timeout <= 0) |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
214 return OS_OK; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
215 prevtime = newtime; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
216 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
217 } else |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
218 return res; |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
219 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
220 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
221 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
222 inline int os::listen(int fd, int count) { |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
223 return ::listen(fd, count); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
224 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
225 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
226 inline int os::connect(int fd, struct sockaddr* him, socklen_t len) { |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
227 RESTARTABLE_RETURN_INT(::connect(fd, him, len)); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
228 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
229 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
230 inline int os::accept(int fd, struct sockaddr* him, socklen_t* len) { |
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
231 // Linux doc says this can't return EINTR, unlike accept() on Solaris. |
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
232 // But see attachListener_linux.cpp, LinuxAttachListener::dequeue(). |
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
233 return (int)::accept(fd, him, len); |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
234 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
235 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
236 inline int os::recvfrom(int fd, char* buf, size_t nBytes, uint flags, |
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
237 sockaddr* from, socklen_t* fromlen) { |
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
238 RESTARTABLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes, flags, from, fromlen)); |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
239 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
240 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
241 inline int os::sendto(int fd, char* buf, size_t len, uint flags, |
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
242 struct sockaddr* to, socklen_t tolen) { |
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
243 RESTARTABLE_RETURN_INT((int)::sendto(fd, buf, len, flags, to, tolen)); |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
244 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
245 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
246 inline int os::socket_shutdown(int fd, int howto) { |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
247 return ::shutdown(fd, howto); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
248 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
249 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
250 inline int os::bind(int fd, struct sockaddr* him, socklen_t len) { |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
251 return ::bind(fd, him, len); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
252 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
253 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
254 inline int os::get_sock_name(int fd, struct sockaddr* him, socklen_t* len) { |
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
255 return ::getsockname(fd, him, len); |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
256 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
257 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
258 inline int os::get_host_name(char* name, int namelen) { |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
259 return ::gethostname(name, namelen); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
260 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
261 |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
262 inline struct hostent* os::get_host_by_name(char* name) { |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
263 return ::gethostbyname(name); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
264 } |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
265 |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
266 inline int os::get_sock_opt(int fd, int level, int optname, |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
267 char* optval, socklen_t* optlen) { |
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
268 return ::getsockopt(fd, level, optname, optval, optlen); |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
269 } |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
270 |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
271 inline int os::set_sock_opt(int fd, int level, int optname, |
4717
11c26bfcf8c7
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
2426
diff
changeset
|
272 const char* optval, socklen_t optlen) { |
1980
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
273 return ::setsockopt(fd, level, optname, optval, optlen); |
828eafbd85cc
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
1972
diff
changeset
|
274 } |
8675
63e54c37ac64
8008959: Fix non-PCH build on Linux, Windows and MacOS X
simonis
parents:
7623
diff
changeset
|
275 |
1972 | 276 #endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP |