1 /*
2 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2012, 2013 SAP AG. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
36 #include <sys/ioctl.h>
37 #include <netdb.h>
38
39 inline void* os::thread_local_storage_at(int index) {
40 return pthread_getspecific((pthread_key_t)index);
41 }
42
43 // File names are case-sensitive on windows only
44 inline int os::file_name_strcmp(const char* s1, const char* s2) {
45 return strcmp(s1, s2);
46 }
47
48 inline bool os::obsolete_option(const JavaVMOption *option) {
49 return false;
50 }
51
52 inline bool os::uses_stack_guard_pages() {
53 return true;
54 }
55
56 inline bool os::allocate_stack_guard_pages() {
57 assert(uses_stack_guard_pages(), "sanity check");
58 return true;
59 }
60
61
62 // On Aix, reservations are made on a page by page basis, nothing to do.
63 inline void os::pd_split_reserved_memory(char *base, size_t size,
64 size_t split, bool realloc) {
65 }
66
67
68 // Bang the shadow pages if they need to be touched to be mapped.
69 inline void os::bang_stack_shadow_pages() {
70 }
71
72 inline void os::dll_unload(void *lib) {
73 ::dlclose(lib);
74 }
75
76 inline const int os::default_file_open_flags() { return 0;}
77
78 inline DIR* os::opendir(const char* dirname)
79 {
80 assert(dirname != NULL, "just checking");
81 return ::opendir(dirname);
82 }
83
84 inline int os::readdir_buf_size(const char *path)
85 {
86 // according to aix sys/limits, NAME_MAX must be retrieved at runtime. */
87 const long my_NAME_MAX = pathconf(path, _PC_NAME_MAX);
157 inline int os::close(int fd) {
158 return ::close(fd);
159 }
160
161 inline int os::socket_close(int fd) {
162 return ::close(fd);
163 }
164
165 inline int os::socket(int domain, int type, int protocol) {
166 return ::socket(domain, type, protocol);
167 }
168
169 inline int os::recv(int fd, char* buf, size_t nBytes, uint flags) {
170 RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, flags));
171 }
172
173 inline int os::send(int fd, char* buf, size_t nBytes, uint flags) {
174 RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags));
175 }
176
177 inline int os::raw_send(int fd, char* buf, size_t nBytes, uint flags) {
178 return os::send(fd, buf, nBytes, flags);
179 }
180
181 inline int os::connect(int fd, struct sockaddr* him, socklen_t len) {
182 RESTARTABLE_RETURN_INT(::connect(fd, him, len));
183 }
184
185 inline struct hostent* os::get_host_by_name(char* name) {
186 return ::gethostbyname(name);
187 }
188
189 inline bool os::supports_monotonic_clock() {
190 // mread_real_time() is monotonic on AIX (see os::javaTimeNanos() comments)
191 return true;
192 }
193
194 inline void os::exit(int num) {
195 ::exit(num);
196 }
197
198 #endif // OS_AIX_VM_OS_AIX_INLINE_HPP
|
1 /*
2 * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2012, 2015 SAP AG. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
36 #include <sys/ioctl.h>
37 #include <netdb.h>
38
39 inline void* os::thread_local_storage_at(int index) {
40 return pthread_getspecific((pthread_key_t)index);
41 }
42
43 // File names are case-sensitive on windows only
44 inline int os::file_name_strcmp(const char* s1, const char* s2) {
45 return strcmp(s1, s2);
46 }
47
48 inline bool os::obsolete_option(const JavaVMOption *option) {
49 return false;
50 }
51
52 inline bool os::uses_stack_guard_pages() {
53 return true;
54 }
55
56 // Whether or not calling code should/can commit/uncommit stack pages
57 // before guarding them. Answer for AIX is definitly no, because we
58 // operate on C heap.
59 inline bool os::allocate_stack_guard_pages() {
60 assert(uses_stack_guard_pages(), "sanity check");
61 return false;
62 }
63
64 // On Aix, reservations are made on a page by page basis, nothing to do.
65 inline void os::pd_split_reserved_memory(char *base, size_t size,
66 size_t split, bool realloc) {
67 }
68
69 // Bang the shadow pages if they need to be touched to be mapped.
70 inline void os::bang_stack_shadow_pages() {
71 }
72
73 inline void os::dll_unload(void *lib) {
74 ::dlclose(lib);
75 }
76
77 inline const int os::default_file_open_flags() { return 0;}
78
79 inline DIR* os::opendir(const char* dirname)
80 {
81 assert(dirname != NULL, "just checking");
82 return ::opendir(dirname);
83 }
84
85 inline int os::readdir_buf_size(const char *path)
86 {
87 // according to aix sys/limits, NAME_MAX must be retrieved at runtime. */
88 const long my_NAME_MAX = pathconf(path, _PC_NAME_MAX);
158 inline int os::close(int fd) {
159 return ::close(fd);
160 }
161
162 inline int os::socket_close(int fd) {
163 return ::close(fd);
164 }
165
166 inline int os::socket(int domain, int type, int protocol) {
167 return ::socket(domain, type, protocol);
168 }
169
170 inline int os::recv(int fd, char* buf, size_t nBytes, uint flags) {
171 RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, flags));
172 }
173
174 inline int os::send(int fd, char* buf, size_t nBytes, uint flags) {
175 RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags));
176 }
177
178 inline int os::raw_send(int fd, char *buf, size_t nBytes, uint flags) {
179 return os::send(fd, buf, nBytes, flags);
180 }
181
182 inline int os::connect(int fd, struct sockaddr *him, socklen_t len) {
183 RESTARTABLE_RETURN_INT(::connect(fd, him, len));
184 }
185
186 inline struct hostent* os::get_host_by_name(char* name) {
187 return ::gethostbyname(name);
188 }
189
190 inline bool os::supports_monotonic_clock() {
191 // mread_real_time() is monotonic on AIX (see os::javaTimeNanos() comments)
192 return true;
193 }
194
195 inline void os::exit(int num) {
196 ::exit(num);
197 }
198
199 #endif // OS_AIX_VM_OS_AIX_INLINE_HPP
|