List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:April 22 1999 1:24pm
Subject:Re: Compilation error on AIX 4.3.2
View as plain text  
>>>>> "Steve" == Steve HOUCHEN <Steve_HOUCHEN@stripped> writes:

Steve> Monty,
Steve>      I changed line 420 of my_pthread.c to be:

Steve>   hp= (struct hostent *)gethostbyname_r(name,result,(struct hostent_data *)
Steve> buffer);

Steve>      and it compiled correctly.  Hopefully, the link error will disappear
Steve> now!

Hi!

What does 'gethostbyname_r' return on your system?  if it returns an
int, you have to do the following change:

struct hostent *my_gethostbyname_r(const char *name,
				   struct hostent *result, char *buffer,
				   int buflen, int *h_errnop)
{
  struct hostent *hp;
  assert(buflen >= sizeof(struct hostent_data));
  hp= gethostbyname_r(name,result,(struct hostent_data *) buffer);
  *h_errnop= errno;
  return hp;
}

->

struct hostent *my_gethostbyname_r(const char *name,
				   struct hostent *result, char *buffer,
				   int buflen, int *h_errnop)
{
  struct hostent *hp;
  assert(buflen >= sizeof(struct hostent_data));
  gethostbyname_r(name,result,(struct hostent_data *) buffer);
  *h_errnop= errno;
  return buffer;
}


Regards,
Monty
Thread
Compilation error on AIX 4.3.2Steve_HOUCHEN21 Apr
  • Compilation error on AIX 4.3.2Michael Widenius22 Apr
Re: Compilation error on AIX 4.3.2Steve_HOUCHEN22 Apr
  • Re: Compilation error on AIX 4.3.2Michael Widenius25 Apr
Re: Compilation error on AIX 4.3.2Steve_HOUCHEN22 Apr
  • Re: Compilation error on AIX 4.3.2Michael Widenius25 Apr