Review Request (M) - 7157695 - Add windows implementation of socket interface

Christian Thalinger christian.thalinger at oracle.com
Thu Mar 29 10:42:26 PDT 2012


I'm pretty sure this gets us into trouble with some compiler somewhere (I'd guess GCC on Linux).  On Mac OS X send is declared as:

     ssize_t
     send(int socket, const void *buffer, size_t length, int flags);

but length is now passed as int:

-inline int os::send(int fd, char* buf, size_t nBytes, uint flags) {
+inline int os::send(int fd, char* buf, int nBytes, int flags) {
   RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags));
 }

I think your changes are good but we might need some casts down in the OS files eventually.

-- Chris

On Mar 29, 2012, at 3:00 PM, Nils Eliasson wrote:

> http://cr.openjdk.java.net/~neliasso/7157695/webrev.01/ <http://cr.openjdk.java.net/%7Eneliasso/7157695/webrev.01/>
> 
> 7157695 - Add windows implementation of socket interface
> 
> Using winsock api which is almost posix compatible. Also changing some argument types for the socket interface calls in os.hpp to make the platform independent code more platform independent. This made the win implementation possible without casts, and allowed me to remove a lot of redundant casts from the jni exports in jvm.cpp.



More information about the hotspot-dev mailing list