src/os/bsd/vm/os_bsd.inline.hpp

Print this page
rev 4205 : Fix non-PCH build on Linux, Windows and MacOS X


   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_BSD_VM_OS_BSD_INLINE_HPP
  26 #define OS_BSD_VM_OS_BSD_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_bsd_x86
  33 # include "orderAccess_bsd_x86.inline.hpp"
  34 #endif
  35 #ifdef TARGET_OS_ARCH_bsd_zero
  36 # include "orderAccess_bsd_zero.inline.hpp"
  37 #endif
  38 
  39 // System includes
  40 
  41 #include <unistd.h>
  42 #include <sys/socket.h>
  43 #include <sys/poll.h>
  44 #include <netdb.h>
  45 
  46 inline void* os::thread_local_storage_at(int index) {
  47   return pthread_getspecific((pthread_key_t)index);
  48 }


 269   return ::getsockname(fd, him, len);
 270 }
 271 
 272 inline int os::get_host_name(char* name, int namelen) {
 273   return ::gethostname(name, namelen);
 274 }
 275 
 276 inline struct hostent* os::get_host_by_name(char* name) {
 277   return ::gethostbyname(name);
 278 }
 279 
 280 inline int os::get_sock_opt(int fd, int level, int optname,
 281                             char *optval, socklen_t* optlen) {
 282   return ::getsockopt(fd, level, optname, optval, optlen);
 283 }
 284 
 285 inline int os::set_sock_opt(int fd, int level, int optname,
 286                             const char* optval, socklen_t optlen) {
 287   return ::setsockopt(fd, level, optname, optval, optlen);
 288 }

















 289 #endif // OS_BSD_VM_OS_BSD_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_BSD_VM_OS_BSD_INLINE_HPP
  26 #define OS_BSD_VM_OS_BSD_INLINE_HPP
  27 

  28 #include "runtime/atomic.inline.hpp"
  29 #include "runtime/os.hpp"
  30 
  31 #ifdef TARGET_OS_ARCH_bsd_x86
  32 # include "orderAccess_bsd_x86.inline.hpp"
  33 #endif
  34 #ifdef TARGET_OS_ARCH_bsd_zero
  35 # include "orderAccess_bsd_zero.inline.hpp"
  36 #endif
  37 
  38 // System includes
  39 
  40 #include <unistd.h>
  41 #include <sys/socket.h>
  42 #include <sys/poll.h>
  43 #include <netdb.h>
  44 
  45 inline void* os::thread_local_storage_at(int index) {
  46   return pthread_getspecific((pthread_key_t)index);
  47 }


 268   return ::getsockname(fd, him, len);
 269 }
 270 
 271 inline int os::get_host_name(char* name, int namelen) {
 272   return ::gethostname(name, namelen);
 273 }
 274 
 275 inline struct hostent* os::get_host_by_name(char* name) {
 276   return ::gethostbyname(name);
 277 }
 278 
 279 inline int os::get_sock_opt(int fd, int level, int optname,
 280                             char *optval, socklen_t* optlen) {
 281   return ::getsockopt(fd, level, optname, optval, optlen);
 282 }
 283 
 284 inline int os::set_sock_opt(int fd, int level, int optname,
 285                             const char* optval, socklen_t optlen) {
 286   return ::setsockopt(fd, level, optname, optval, optlen);
 287 }
 288 
 289 inline void os::Bsd::SuspendResume::set_suspended()           {
 290   jint temp, temp2;
 291   do {
 292     temp = _state;
 293     temp2 = Atomic::cmpxchg(temp | SR_SUSPENDED, &_state, temp);
 294   } while (temp2 != temp);
 295 }
 296 
 297 inline void os::Bsd::SuspendResume::clear_suspended()        {
 298   jint temp, temp2;
 299   do {
 300     temp = _state;
 301     temp2 = Atomic::cmpxchg(temp & ~SR_SUSPENDED, &_state, temp);
 302   } while (temp2 != temp);
 303 }
 304 
 305 #endif // OS_BSD_VM_OS_BSD_INLINE_HPP