author | dholmes |
Tue, 05 Feb 2019 20:18:00 -0500 | |
changeset 53654 | 7054249afee5 |
parent 53266 | 57d8566a2732 |
child 55524 | b279ae9843b8 |
child 58678 | 9cf78a70fa4f |
permissions | -rw-r--r-- |
1 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52508
diff
changeset
|
2 |
* Copyright (c) 1999, 2019, 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 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52508
diff
changeset
|
25 |
#ifndef OS_LINUX_OS_LINUX_INLINE_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52508
diff
changeset
|
26 |
#define OS_LINUX_OS_LINUX_INLINE_HPP |
7397 | 27 |
|
28 |
#include "runtime/os.hpp" |
|
53654
7054249afee5
8217843: Performance regression related to os::supports_monotonic_clock() on linux
dholmes
parents:
53266
diff
changeset
|
29 |
#include "os_posix.inline.hpp" |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
13963
diff
changeset
|
30 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
31 |
// System includes |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
32 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
33 |
#include <unistd.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
34 |
#include <sys/socket.h> |
46454
f090a0a198cd
8180003: Remove sys/ prefix from poll.h and signal.h includes
mikael
parents:
39390
diff
changeset
|
35 |
#include <poll.h> |
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
36 |
#include <netdb.h> |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
37 |
|
50199
83d8b3a25f25
8199807: AppCDS performs overly restrictive path matching check.
jiangli
parents:
49957
diff
changeset
|
38 |
// File names are case-insensitive on windows only |
83d8b3a25f25
8199807: AppCDS performs overly restrictive path matching check.
jiangli
parents:
49957
diff
changeset
|
39 |
inline int os::file_name_strncmp(const char* s1, const char* s2, size_t num) { |
83d8b3a25f25
8199807: AppCDS performs overly restrictive path matching check.
jiangli
parents:
49957
diff
changeset
|
40 |
return strncmp(s1, s2, num); |
1 | 41 |
} |
42 |
||
43 |
inline bool os::uses_stack_guard_pages() { |
|
44 |
return true; |
|
45 |
} |
|
46 |
||
39390
edf6a424a8b7
8159335: Fix problems with stack overflow handling.
goetz
parents:
35479
diff
changeset
|
47 |
inline bool os::must_commit_stack_guard_pages() { |
1 | 48 |
assert(uses_stack_guard_pages(), "sanity check"); |
49 |
return true; |
|
50 |
} |
|
51 |
||
52 |
||
53 |
// On Linux, reservations are made on a page by page basis, nothing to do. |
|
13195 | 54 |
inline void os::pd_split_reserved_memory(char *base, size_t size, |
1 | 55 |
size_t split, bool realloc) { |
56 |
} |
|
57 |
||
58 |
||
59 |
// Bang the shadow pages if they need to be touched to be mapped. |
|
39390
edf6a424a8b7
8159335: Fix problems with stack overflow handling.
goetz
parents:
35479
diff
changeset
|
60 |
inline void os::map_stack_shadow_pages(address sp) { |
1 | 61 |
} |
62 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
63 |
inline void os::dll_unload(void *lib) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
64 |
::dlclose(lib); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
65 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
66 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
67 |
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
|
68 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
69 |
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
|
70 |
return (jlong) ::lseek64(fd, offset, whence); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
71 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
72 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
73 |
inline int os::fsync(int fd) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
74 |
return ::fsync(fd); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
75 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
76 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
77 |
inline int os::ftruncate(int fd, jlong length) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
78 |
return ::ftruncate64(fd, length); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
79 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
80 |
|
1 | 81 |
// macros for restartable system calls |
82 |
||
83 |
#define RESTARTABLE(_cmd, _result) do { \ |
|
84 |
_result = _cmd; \ |
|
85 |
} while(((int)_result == OS_ERR) && (errno == EINTR)) |
|
86 |
||
87 |
#define RESTARTABLE_RETURN_INT(_cmd) do { \ |
|
88 |
int _result; \ |
|
89 |
RESTARTABLE(_cmd, _result); \ |
|
90 |
return _result; \ |
|
91 |
} while(false) |
|
388 | 92 |
|
93 |
inline bool os::numa_has_static_binding() { return true; } |
|
94 |
inline bool os::numa_has_group_homing() { return false; } |
|
7397 | 95 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
96 |
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
|
97 |
size_t res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
98 |
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
|
99 |
return res; |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
100 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
101 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
102 |
inline int os::close(int fd) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
103 |
return ::close(fd); |
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 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
106 |
inline int os::socket_close(int fd) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
107 |
return ::close(fd); |
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 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
110 |
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
|
111 |
return ::socket(domain, type, protocol); |
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 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
114 |
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
|
115 |
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
|
116 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
117 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
118 |
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
|
119 |
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
|
120 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
121 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
122 |
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
|
123 |
return os::send(fd, buf, nBytes, flags); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
124 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
125 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
126 |
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
|
127 |
RESTARTABLE_RETURN_INT(::connect(fd, him, len)); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
128 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
129 |
|
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
130 |
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
|
131 |
return ::gethostbyname(name); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
132 |
} |
11256
025cd1741566
7091417: recvfrom's 6th input should be of type socklen_t
phh
parents:
8921
diff
changeset
|
133 |
|
22891
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18025
diff
changeset
|
134 |
inline bool os::supports_monotonic_clock() { |
51989
7ac0ac1e57b6
8211175: Remove temporary clock initialization duplication
dholmes
parents:
51106
diff
changeset
|
135 |
return os::Posix::supports_monotonic_clock(); |
22891
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18025
diff
changeset
|
136 |
} |
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18025
diff
changeset
|
137 |
|
26682
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
138 |
inline void os::exit(int num) { |
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
139 |
::exit(num); |
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
140 |
} |
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
141 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52508
diff
changeset
|
142 |
#endif // OS_LINUX_OS_LINUX_INLINE_HPP |