Re: native-lib errors on IRIX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Jenner wrote:

On Tue, 2006-09-12 at 19:28 +0200, Christian Thalinger wrote:
We have some problems building current CVS heads with tgolem on an IRIX
machine.  The problems are located in native-lib, like:

cc-1020 cc: ERROR File = cpnet.c, Line = 260
  The identifier "SOCKET_NOSIGNAL" is undefined.

      ret = send(fd, data, len, SOCKET_NOSIGNAL);
                                ^
or

cc-1136 cc: ERROR File = cpnet.c, Line = 613
  Too many arguments in function call.

          ret = gethostbyname_r (hostname, &hret, buf, buflen, &result, &herr);
- twisti

                                                                        ^
Any ideas how to fix these issues, especially the gethostbyname_r one?

Guess you found it already but did you see patch to fix these issues on
other platforms from Andreas Tobler recently:

http://lists.gnu.org/archive/html/commit-classpath/2006-08/msg00272.html

Looks like it didn't fix it for IRIX but maybe he has some ideas?

Problem is, that only linux, darwin and FreeBSD support a usable flag for this kind of call. I did not find a solution for other archs and my sparc and hpuxen will also fail when cp gets reimported to gcc. I tried to pass 0 for these platforms but I was told to error instead. (Tom T.)

I also tried to suggest to:
#ifndef MSG_NOSIGNAL
        signal (SIGPIPE, SIG_IGN);
#endif
...

But this was also not a good solution....

So far I have no more suggestions.

For the gethostbyname_r case, IRIX uses 5 arguments:

int gethostbyname_r(char *hostname, struct hostent *hostent, char *buffer, int buflen, int *h_errnop)

Here you could modify the call to gethostbyname_r like this:

#ifdef IRIX
	ret = gethostbyname_r (hostname, &hret, buf, buflen, &herr);
#endif

This part needs to be modified as well, and I see I need to do that anyway since in case we call gethostbyname we do not have a proper result......

	if (ret != 0 || result == NULL)
        {
          if (herr == ERANGE)
            {
              buflen *= 2;
              JCL_free(env, buf);
              continue;
            }
          JCL_free(env, buf);

          return -herr;
        }

While Linux and others use the 6 argument variant:

int gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop)

Btw, AIX4, Digital Unix/Tru64, HPUX 10 use three arguments:
int gethostbyname_r(char *hostname, struct hostent *hostent, struct hostent_data *data)

So far comments.

hth,
Andreas


[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux