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 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
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/atomic.inline.hpp"
30 #include "runtime/os.hpp"
31
32 #ifdef TARGET_OS_ARCH_linux_x86
33 # include "orderAccess_linux_x86.inline.hpp"
34 #endif
35 #ifdef TARGET_OS_ARCH_linux_sparc
36 # include "orderAccess_linux_sparc.inline.hpp"
37 #endif
38 #ifdef TARGET_OS_ARCH_linux_zero
39 # include "orderAccess_linux_zero.inline.hpp"
40 #endif
41 #ifdef TARGET_OS_ARCH_linux_arm
42 # include "orderAccess_linux_arm.inline.hpp"
43 #endif
44 #ifdef TARGET_OS_ARCH_linux_ppc
45 # include "orderAccess_linux_ppc.inline.hpp"
46 #endif
47
48 // System includes
271 return ::getsockname(fd, him, len);
272 }
273
274 inline int os::get_host_name(char* name, int namelen) {
275 return ::gethostname(name, namelen);
276 }
277
278 inline struct hostent* os::get_host_by_name(char* name) {
279 return ::gethostbyname(name);
280 }
281
282 inline int os::get_sock_opt(int fd, int level, int optname,
283 char* optval, socklen_t* optlen) {
284 return ::getsockopt(fd, level, optname, optval, optlen);
285 }
286
287 inline int os::set_sock_opt(int fd, int level, int optname,
288 const char* optval, socklen_t optlen) {
289 return ::setsockopt(fd, level, optname, optval, optlen);
290 }
291 #endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP
|
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 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef OS_LINUX_VM_OS_LINUX_INLINE_HPP
26 #define OS_LINUX_VM_OS_LINUX_INLINE_HPP
27
28 #include "runtime/atomic.inline.hpp"
29 #include "runtime/os.hpp"
30
31 #ifdef TARGET_OS_ARCH_linux_x86
32 # include "orderAccess_linux_x86.inline.hpp"
33 #endif
34 #ifdef TARGET_OS_ARCH_linux_sparc
35 # include "orderAccess_linux_sparc.inline.hpp"
36 #endif
37 #ifdef TARGET_OS_ARCH_linux_zero
38 # include "orderAccess_linux_zero.inline.hpp"
39 #endif
40 #ifdef TARGET_OS_ARCH_linux_arm
41 # include "orderAccess_linux_arm.inline.hpp"
42 #endif
43 #ifdef TARGET_OS_ARCH_linux_ppc
44 # include "orderAccess_linux_ppc.inline.hpp"
45 #endif
46
47 // System includes
270 return ::getsockname(fd, him, len);
271 }
272
273 inline int os::get_host_name(char* name, int namelen) {
274 return ::gethostname(name, namelen);
275 }
276
277 inline struct hostent* os::get_host_by_name(char* name) {
278 return ::gethostbyname(name);
279 }
280
281 inline int os::get_sock_opt(int fd, int level, int optname,
282 char* optval, socklen_t* optlen) {
283 return ::getsockopt(fd, level, optname, optval, optlen);
284 }
285
286 inline int os::set_sock_opt(int fd, int level, int optname,
287 const char* optval, socklen_t optlen) {
288 return ::setsockopt(fd, level, optname, optval, optlen);
289 }
290
291 inline void os::Linux::SuspendResume::set_suspended() {
292 jint temp, temp2;
293 do {
294 temp = _state;
295 temp2 = Atomic::cmpxchg(temp | SR_SUSPENDED, &_state, temp);
296 } while (temp2 != temp);
297 }
298
299 inline void os::Linux::SuspendResume::clear_suspended() {
300 jint temp, temp2;
301 do {
302 temp = _state;
303 temp2 = Atomic::cmpxchg(temp & ~SR_SUSPENDED, &_state, temp);
304 } while (temp2 != temp);
305 }
306
307 #endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP
|