src/os/solaris/vm/os_solaris.cpp compilation failed on SPARC

Christian Thalinger christian.thalinger at oracle.com
Wed Oct 19 05:21:09 PDT 2011


Today when I tried to build solaris-sparc I got the following error:

"/home/ct232829/hsx/hotspot-comp/7090904/src/os/solaris/vm/os_solaris.cpp", line 6440: Error: Formal argument 6 of type unsigned* in call to recvfrom(int, void*, unsigned, int, sockaddr*, unsigned*) is being passed int*.
"/home/ct232829/hsx/hotspot-comp/7090904/src/os/solaris/vm/os_solaris.cpp", line 6440: Error: Formal argument 6 of type unsigned* in call to recvfrom(int, void*, unsigned, int, sockaddr*, unsigned*) is being passed int*.

The compiler used was:

$ CC -V
CC: Sun C++ 5.10 SunOS_sparc 128228-09 2010/06/24
Usage: CC [ options ] files.  Use 'CC -flags' for details

The manpage has the following to say:

     ssize_t recvfrom(int s, void *buf, size_t len, int flags,
          struct sockaddr *from, socklen_t *fromlen);

So the suggested fix would be:

diff -r e5928e7dab26 src/os/solaris/vm/os_solaris.cpp
--- a/src/os/solaris/vm/os_solaris.cpp
+++ b/src/os/solaris/vm/os_solaris.cpp
@@ -6437,7 +6437,7 @@ int os::recvfrom(int fd, char *buf, int 
                              sockaddr *from, int *fromlen) {
    //%%note jvm_r11
   INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes,\
-    flags, from, fromlen), os::Solaris::clear_interrupted);
+    flags, from, (socklen_t*) fromlen), os::Solaris::clear_interrupted);
 }
 
 int os::sendto(int fd, char *buf, int len, int flags,

-- Chris


More information about the hotspot-runtime-dev mailing list