1.1 --- a/src/os/linux/vm/os_linux.inline.hpp Mon Dec 19 21:38:51 2011 -0800 1.2 +++ b/src/os/linux/vm/os_linux.inline.hpp Wed Dec 21 15:48:16 2011 -0500 1.3 @@ -202,15 +202,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 @@ -250,57 +250,53 @@ 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 linux. 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 - // Linux doc says this can't return EINTR, unlike accept() on Solaris 1.40 - 1.41 - return ::accept(fd, him, (socklen_t *)len); 1.42 +inline int os::accept(int fd, struct sockaddr* him, socklen_t* len) { 1.43 + // Linux doc says this can't return EINTR, unlike accept() on Solaris. 1.44 + // But see attachListener_linux.cpp, LinuxAttachListener::dequeue(). 1.45 + return (int)::accept(fd, him, len); 1.46 } 1.47 1.48 -inline int os::recvfrom(int fd, char *buf, int nBytes, int flags, 1.49 - sockaddr *from, int *fromlen) { 1.50 - RESTARTABLE_RETURN_INT(::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen)); 1.51 +inline int os::recvfrom(int fd, char* buf, size_t nBytes, uint flags, 1.52 + sockaddr* from, socklen_t* fromlen) { 1.53 + RESTARTABLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes, flags, from, fromlen)); 1.54 } 1.55 1.56 -inline int os::sendto(int fd, char *buf, int len, int flags, 1.57 - struct sockaddr *to, int tolen) { 1.58 - RESTARTABLE_RETURN_INT(::sendto(fd, buf, len, (unsigned int) flags, to, tolen)); 1.59 +inline int os::sendto(int fd, char* buf, size_t len, uint flags, 1.60 + struct sockaddr* to, socklen_t tolen) { 1.61 + RESTARTABLE_RETURN_INT((int)::sendto(fd, buf, len, flags, to, tolen)); 1.62 } 1.63 1.64 -inline int os::socket_shutdown(int fd, int howto){ 1.65 +inline int os::socket_shutdown(int fd, int howto) { 1.66 return ::shutdown(fd, howto); 1.67 } 1.68 1.69 -inline int os::bind(int fd, struct sockaddr *him, int len){ 1.70 +inline int os::bind(int fd, struct sockaddr* him, socklen_t len) { 1.71 return ::bind(fd, him, len); 1.72 } 1.73 1.74 -inline int os::get_sock_name(int fd, struct sockaddr *him, int *len){ 1.75 - return ::getsockname(fd, him, (socklen_t *)len); 1.76 +inline int os::get_sock_name(int fd, struct sockaddr* him, socklen_t* len) { 1.77 + return ::getsockname(fd, him, len); 1.78 } 1.79 1.80 -inline int os::get_host_name(char* name, int namelen){ 1.81 +inline int os::get_host_name(char* name, int namelen) { 1.82 return ::gethostname(name, namelen); 1.83 } 1.84 1.85 -inline struct hostent* os::get_host_by_name(char* name) { 1.86 +inline struct hostent* os::get_host_by_name(char* name) { 1.87 return ::gethostbyname(name); 1.88 } 1.89 + 1.90 inline int os::get_sock_opt(int fd, int level, int optname, 1.91 - char *optval, int* optlen){ 1.92 - return ::getsockopt(fd, level, optname, optval, (socklen_t *)optlen); 1.93 + char* optval, socklen_t* optlen) { 1.94 + return ::getsockopt(fd, level, optname, optval, optlen); 1.95 } 1.96 1.97 inline int os::set_sock_opt(int fd, int level, int optname, 1.98 - const char *optval, int optlen){ 1.99 + const char* optval, socklen_t optlen) { 1.100 return ::setsockopt(fd, level, optname, optval, optlen); 1.101 } 1.102 #endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP