hotspot/src/os/bsd/vm/os_bsd.inline.hpp
author serb
Wed, 13 May 2015 19:19:03 +0300
changeset 30931 dad3f622d47a
parent 27400 c5955f4b7c84
child 34633 2a6c7c7b30a7
permissions -rw-r--r--
5109918: Wrong documentation for JSpinner.DateEditor constructor Reviewed-by: alexsch, azvegint
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     1
/*
22891
1f5d1fff23fa 6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents: 18078
diff changeset
     2
 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     4
 *
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     7
 * published by the Free Software Foundation.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     8
 *
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    13
 * accompanied this code).
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    14
 *
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    18
 *
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    21
 * questions.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    22
 *
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    23
 */
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    24
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    25
#ifndef OS_BSD_VM_OS_BSD_INLINE_HPP
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    26
#define OS_BSD_VM_OS_BSD_INLINE_HPP
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    27
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    28
#include "runtime/os.hpp"
14626
0cf4eccf130f 8003240: x86: move MacroAssembler into separate file
twisti
parents: 13963
diff changeset
    29
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    30
// System includes
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    31
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    32
#include <unistd.h>
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    33
#include <sys/socket.h>
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    34
#include <sys/poll.h>
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    35
#include <netdb.h>
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    36
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    37
inline void* os::thread_local_storage_at(int index) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    38
  return pthread_getspecific((pthread_key_t)index);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    39
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    40
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    41
// File names are case-sensitive on windows only
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    42
inline int os::file_name_strcmp(const char* s1, const char* s2) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    43
  return strcmp(s1, s2);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    44
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    45
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    46
inline bool os::obsolete_option(const JavaVMOption *option) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    47
  return false;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    48
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    49
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    50
inline bool os::uses_stack_guard_pages() {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    51
  return true;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    52
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    53
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    54
inline bool os::allocate_stack_guard_pages() {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    55
  assert(uses_stack_guard_pages(), "sanity check");
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    56
#if !defined(__FreeBSD__) || __FreeBSD__ < 5
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    57
  // Since FreeBSD 4 uses malloc() for allocating the thread stack
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    58
  // there is no need to do anything extra to allocate the guard pages
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    59
  return false;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    60
#else
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    61
  // FreeBSD 5+ uses mmap MAP_STACK for allocating the thread stacks.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    62
  // Must 'allocate' them or guard pages are ignored.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    63
  return true;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    64
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    65
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    66
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    67
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    68
// On Bsd, reservations are made on a page by page basis, nothing to do.
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 11256
diff changeset
    69
inline void os::pd_split_reserved_memory(char *base, size_t size,
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    70
                                      size_t split, bool realloc) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    71
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    72
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    73
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    74
// Bang the shadow pages if they need to be touched to be mapped.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    75
inline void os::bang_stack_shadow_pages() {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    76
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    77
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    78
inline void os::dll_unload(void *lib) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    79
  ::dlclose(lib);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    80
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    81
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    82
inline const int os::default_file_open_flags() { return 0;}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    83
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    84
inline DIR* os::opendir(const char* dirname)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    85
{
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    86
  assert(dirname != NULL, "just checking");
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    87
  return ::opendir(dirname);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    88
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    89
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    90
inline int os::readdir_buf_size(const char *path)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    91
{
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    92
  return NAME_MAX + sizeof(dirent) + 1;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    93
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    94
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    95
inline jlong os::lseek(int fd, jlong offset, int whence) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    96
  return (jlong) ::lseek(fd, offset, whence);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    97
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    98
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    99
inline int os::fsync(int fd) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   100
  return ::fsync(fd);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   101
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   102
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   103
inline char* os::native_path(char *path) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   104
  return path;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   105
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   106
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   107
inline int os::ftruncate(int fd, jlong length) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   108
  return ::ftruncate(fd, length);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   109
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   110
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   111
inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   112
{
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   113
  dirent* p;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   114
  int status;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   115
  assert(dirp != NULL, "just checking");
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   116
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   117
  // NOTE: Bsd readdir_r (on RH 6.2 and 7.2 at least) is NOT like the POSIX
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   118
  // version. Here is the doc for this function:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   119
  // http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_262.html
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   120
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   121
  if((status = ::readdir_r(dirp, dbuf, &p)) != 0) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   122
    errno = status;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   123
    return NULL;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   124
  } else
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   125
    return p;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   126
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   127
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   128
inline int os::closedir(DIR *dirp) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   129
  assert(dirp != NULL, "argument is NULL");
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   130
  return ::closedir(dirp);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   131
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   132
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   133
// macros for restartable system calls
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   134
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   135
#define RESTARTABLE(_cmd, _result) do { \
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   136
    _result = _cmd; \
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   137
  } while(((int)_result == OS_ERR) && (errno == EINTR))
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   138
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   139
#define RESTARTABLE_RETURN_INT(_cmd) do { \
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   140
  int _result; \
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   141
  RESTARTABLE(_cmd, _result); \
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   142
  return _result; \
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   143
} while(false)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   144
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   145
inline bool os::numa_has_static_binding()   { return true; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   146
inline bool os::numa_has_group_homing()     { return false;  }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   147
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   148
inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   149
  size_t res;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   150
  RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   151
  return res;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   152
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   153
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   154
inline size_t os::write(int fd, const void *buf, unsigned int nBytes) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   155
  size_t res;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   156
  RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   157
  return res;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   158
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   159
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   160
inline int os::close(int fd) {
18078
10417cf9967d 7178026: os::close can restart ::close but that is not a restartable syscall
rdurbin
parents: 18025
diff changeset
   161
  return ::close(fd);
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   162
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   163
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   164
inline int os::socket_close(int fd) {
18078
10417cf9967d 7178026: os::close can restart ::close but that is not a restartable syscall
rdurbin
parents: 18025
diff changeset
   165
  return ::close(fd);
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   166
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   167
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   168
inline int os::socket(int domain, int type, int protocol) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   169
  return ::socket(domain, type, protocol);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   170
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   171
11256
025cd1741566 7091417: recvfrom's 6th input should be of type socklen_t
phh
parents: 10565
diff changeset
   172
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: 10565
diff changeset
   173
  RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, flags));
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   174
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   175
11256
025cd1741566 7091417: recvfrom's 6th input should be of type socklen_t
phh
parents: 10565
diff changeset
   176
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: 10565
diff changeset
   177
  RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags));
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   178
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   179
11256
025cd1741566 7091417: recvfrom's 6th input should be of type socklen_t
phh
parents: 10565
diff changeset
   180
inline int os::raw_send(int fd, char* buf, size_t nBytes, uint flags) {
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   181
  return os::send(fd, buf, nBytes, flags);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   182
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   183
11256
025cd1741566 7091417: recvfrom's 6th input should be of type socklen_t
phh
parents: 10565
diff changeset
   184
inline int os::connect(int fd, struct sockaddr* him, socklen_t len) {
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   185
  RESTARTABLE_RETURN_INT(::connect(fd, him, len));
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   186
}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   187
11256
025cd1741566 7091417: recvfrom's 6th input should be of type socklen_t
phh
parents: 10565
diff changeset
   188
inline struct hostent* os::get_host_by_name(char* name) {
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   189
  return ::gethostbyname(name);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   190
}
11256
025cd1741566 7091417: recvfrom's 6th input should be of type socklen_t
phh
parents: 10565
diff changeset
   191
22891
1f5d1fff23fa 6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents: 18078
diff changeset
   192
inline bool os::supports_monotonic_clock() {
24239
db81abb281bc 8040140: System.nanoTime() is slow and non-monotonic on OS X
sla
parents: 22891
diff changeset
   193
#ifdef __APPLE__
db81abb281bc 8040140: System.nanoTime() is slow and non-monotonic on OS X
sla
parents: 22891
diff changeset
   194
  return true;
db81abb281bc 8040140: System.nanoTime() is slow and non-monotonic on OS X
sla
parents: 22891
diff changeset
   195
#else
22891
1f5d1fff23fa 6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents: 18078
diff changeset
   196
  return Bsd::_clock_gettime != NULL;
24239
db81abb281bc 8040140: System.nanoTime() is slow and non-monotonic on OS X
sla
parents: 22891
diff changeset
   197
#endif
22891
1f5d1fff23fa 6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents: 18078
diff changeset
   198
}
1f5d1fff23fa 6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents: 18078
diff changeset
   199
26682
f339669ba825 8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents: 25468
diff changeset
   200
inline void os::exit(int num) {
f339669ba825 8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents: 25468
diff changeset
   201
  ::exit(num);
f339669ba825 8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents: 25468
diff changeset
   202
}
f339669ba825 8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents: 25468
diff changeset
   203
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   204
#endif // OS_BSD_VM_OS_BSD_INLINE_HPP