1.1 --- a/src/os/bsd/vm/os_bsd.inline.hpp Mon Dec 19 21:38:51 2011 -0800 1.2 +++ b/src/os/bsd/vm/os_bsd.inline.hpp Wed Dec 21 15:48:16 2011 -0500 1.3 @@ -198,15 +198,15 @@ 1.4 return ::socket(domain, type, protocol); 1.5 } 1.6 1.7 -inline int os::recv(int fd, char *buf, int nBytes, int flags) { 1.8 - RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags)); 1.9 +inline int os::recv(int fd, char* buf, size_t nBytes, uint flags) { 1.10 + RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, flags)); 1.11 } 1.12 1.13 -inline int os::send(int fd, char *buf, int nBytes, int flags) { 1.14 - RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags)); 1.15 +inline int os::send(int fd, char* buf, size_t nBytes, uint flags) { 1.16 + RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags)); 1.17 } 1.18 1.19 -inline int os::raw_send(int fd, char *buf, int nBytes, int flags) { 1.20 +inline int os::raw_send(int fd, char* buf, size_t nBytes, uint flags) { 1.21 return os::send(fd, buf, nBytes, flags); 1.22 } 1.23 1.24 @@ -246,57 +246,52 @@ 1.25 return ::listen(fd, count); 1.26 } 1.27 1.28 -inline int os::connect(int fd, struct sockaddr *him, int len) { 1.29 +inline int os::connect(int fd, struct sockaddr* him, socklen_t len) { 1.30 RESTARTABLE_RETURN_INT(::connect(fd, him, len)); 1.31 } 1.32 1.33 -inline int os::accept(int fd, struct sockaddr *him, int *len) { 1.34 - // This cast is from int to unsigned int on bsd. Since we 1.35 - // only pass the parameter "len" around the vm and don't try to 1.36 - // fetch it's value, this cast is safe for now. The java.net group 1.37 - // may need and want to change this interface someday if socklen_t goes 1.38 - // to 64 bits on some platform that we support. 1.39 - 1.40 +inline int os::accept(int fd, struct sockaddr* him, socklen_t* len) { 1.41 // At least OpenBSD and FreeBSD can return EINTR from accept. 1.42 - RESTARTABLE_RETURN_INT(::accept(fd, him, (socklen_t *)len)); 1.43 + RESTARTABLE_RETURN_INT(::accept(fd, him, len)); 1.44 } 1.45 1.46 -inline int os::recvfrom(int fd, char *buf, int nBytes, int flags, 1.47 - sockaddr *from, int *fromlen) { 1.48 - RESTARTABLE_RETURN_INT(::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen)); 1.49 +inline int os::recvfrom(int fd, char* buf, size_t nBytes, uint flags, 1.50 + sockaddr* from, socklen_t* fromlen) { 1.51 + RESTARTABLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes, flags, from, fromlen)); 1.52 } 1.53 1.54 -inline int os::sendto(int fd, char *buf, int len, int flags, 1.55 - struct sockaddr *to, int tolen) { 1.56 - RESTARTABLE_RETURN_INT(::sendto(fd, buf, len, (unsigned int) flags, to, tolen)); 1.57 +inline int os::sendto(int fd, char* buf, size_t len, uint flags, 1.58 + struct sockaddr *to, socklen_t tolen) { 1.59 + RESTARTABLE_RETURN_INT((int)::sendto(fd, buf, len, flags, to, tolen)); 1.60 } 1.61 1.62 -inline int os::socket_shutdown(int fd, int howto){ 1.63 +inline int os::socket_shutdown(int fd, int howto) { 1.64 return ::shutdown(fd, howto); 1.65 } 1.66 1.67 -inline int os::bind(int fd, struct sockaddr *him, int len){ 1.68 +inline int os::bind(int fd, struct sockaddr* him, socklen_t len) { 1.69 return ::bind(fd, him, len); 1.70 } 1.71 1.72 -inline int os::get_sock_name(int fd, struct sockaddr *him, int *len){ 1.73 - return ::getsockname(fd, him, (socklen_t *)len); 1.74 +inline int os::get_sock_name(int fd, struct sockaddr* him, socklen_t* len) { 1.75 + return ::getsockname(fd, him, len); 1.76 } 1.77 1.78 -inline int os::get_host_name(char* name, int namelen){ 1.79 +inline int os::get_host_name(char* name, int namelen) { 1.80 return ::gethostname(name, namelen); 1.81 } 1.82 1.83 -inline struct hostent* os::get_host_by_name(char* name) { 1.84 +inline struct hostent* os::get_host_by_name(char* name) { 1.85 return ::gethostbyname(name); 1.86 } 1.87 + 1.88 inline int os::get_sock_opt(int fd, int level, int optname, 1.89 - char *optval, int* optlen){ 1.90 - return ::getsockopt(fd, level, optname, optval, (socklen_t *)optlen); 1.91 + char *optval, socklen_t* optlen) { 1.92 + return ::getsockopt(fd, level, optname, optval, optlen); 1.93 } 1.94 1.95 inline int os::set_sock_opt(int fd, int level, int optname, 1.96 - const char *optval, int optlen){ 1.97 + const char* optval, socklen_t optlen) { 1.98 return ::setsockopt(fd, level, optname, optval, optlen); 1.99 } 1.100 #endif // OS_BSD_VM_OS_BSD_INLINE_HPP