HotSpot build on SPARC/Solaris
Dr Andrew John Hughes
ahughes at redhat.com
Tue Sep 6 14:32:14 PDT 2011
On 15:21 Tue 06 Sep , Azeem Jiva wrote:
> Trying to build on SPARC/Solaris I get the following error:
>
> "/root/hsx/src/os/solaris/vm/os_solaris.cpp", line 6428: Error: Formal
> argument 6 of type unsigned* in call to recvfrom(int, void*, unsigned
> long, int, sockaddr*, unsigned*) is being passed int*.
> "/root/hsx/src/os/solaris/vm/os_solaris.cpp", line 6428: Error: Formal
> argument 6 of type unsigned* in call to recvfrom(int, void*, unsigned
> long, int, sockaddr*, unsigned*) is being passed int*.
>
> It seems the method signature changed in Solaris 11 from int pointer to
> an unsigned pointer. I can get around the issue by casting fromlen to
> an unsigned pointer, but that's dangerous. I guess I'm looking for
> ideas for a better solution to this.
>
> diff -r 7588156f5cf9 src/os/solaris/vm/os_solaris.cpp
> --- a/src/os/solaris/vm/os_solaris.cpp Mon Sep 05 17:09:05 2011 -0700
> +++ b/src/os/solaris/vm/os_solaris.cpp Tue Sep 06 20:07:09 2011 +0000
> @@ -6425,7 +6425,7 @@
> sockaddr *from, int *fromlen) {
> //%%note jvm_r11
> INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes,\
> - flags, from, fromlen), os::Solaris::clear_interrupted);
> + flags, from, (unsigned*)fromlen), os::Solaris::clear_interrupted);
> }
>
> int os::sendto(int fd, char *buf, int len, int flags,
>
> --
> Azeem Jiva
> @javawithjiva
>
POSIX says it should actually be socklen_t*:
http://pubs.opengroup.org/onlinepubs/7908799/xns/recvfrom.html
as does both the Linux and OpenSolaris man pages.
--
Andrew :)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D 0698 0713 C3ED F586 2A37
More information about the hotspot-compiler-dev
mailing list