src/os/linux/vm/os_linux.inline.hpp

Print this page
rev 4773 : 8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>


 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


 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 #endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP