$OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_inline_hpp,v 1.1 2013/02/01 15:34:35 kurt Exp $
--- hotspot/src/os/bsd/vm/os_bsd.inline.hpp.orig	Tue Jan 29 11:08:49 2013
+++ hotspot/src/os/bsd/vm/os_bsd.inline.hpp	Tue Jan 29 11:10:34 2013
@@ -191,11 +191,11 @@ inline size_t os::write(int fd, const void *buf, unsig
 }
 
 inline int os::close(int fd) {
-  return ::close(fd);
+  RESTARTABLE_RETURN_INT(::close(fd));
 }
 
 inline int os::socket_close(int fd) {
-  return ::close(fd);
+  RESTARTABLE_RETURN_INT(::close(fd));
 }
 
 inline int os::socket(int domain, int type, int protocol) {
@@ -260,9 +260,9 @@ inline int os::accept(int fd, struct sockaddr *him, in
   // fetch it's value, this cast is safe for now. The java.net group
   // may need and want to change this interface someday if socklen_t goes
   // to 64 bits on some platform that we support.
-  // Bsd doc says this can't return EINTR, unlike accept() on Solaris
 
-  return ::accept(fd, him, (socklen_t *)len);
+  // At least OpenBSD and FreeBSD can return EINTR from accept.
+  RESTARTABLE_RETURN_INT(::accept(fd, him, (socklen_t *)len));
 }
 
 inline int os::recvfrom(int fd, char *buf, int nBytes, int flags,
