Thread View: news.software.readers
1 messages
1 total messages
Started by Filip Gieszczykiewicz
Tue, 16 Nov 1993 08:04
SunSparc10 & gethostbyname (broken)
Author: Filip Gieszczykiewicz
Date: Tue, 16 Nov 1993 08:04
Date: Tue, 16 Nov 1993 08:04
76 lines
3377 bytes
3377 bytes
Greetings. I'm having a hard time with this Sparc10 (sun4m) and
the way it converts "word" addresses to "number" addresses. Namely,
the "gethostbyname" is broken. As a result, programs such as archie,
rn, trn, etc. croak when given a (usually internal) address. I have
proof:
1) Script from a VAX 9000 (correct)
2) Script from this Sun (broken)
3) The test program (very short)
What I'm looking for is more than just a simple fix... could
someone tell me how to routinely correct this problem? Some of the
programs I have to build (soon) never heard of a sun and as such
make life difficult (unless I do a global replace of the address -
but then if that site changes the IP address, I have to rebuild...)
What does this have to do with this group? Well, trn and rn require
an NNTPSERVER when in client mode. This address is usually in the
form "machine.domain" and so it breaks under sun. If I convert it
to IP address, all is fine. This, however, is unacceptable.
Thanks, in advance, for all your help! BTW, I've posted this to the
SunOS groups and will post a summary here.
Take care.
--------------------------------------------------------------------------------
Script started on Tue Nov 16 01:32:24 1993
/tmp> uname -a
ULTRIX unixd2.cis.pitt.edu 4.2 0 RISC
/tmp> cc try.c
/tmp> ./a.out
Hostname = archie.rutgers.edu
Official Name = dorm.Rutgers.EDU
/tmp> exit
script done on Tue Nov 16 01:32:42 1993
--------------------------------------------------------------------------------
Script started on Tue Nov 16 01:35:18 1993
/tmp> uname -a
SunOS alpha.smi 4.1.3 1 sun4m
/tmp> cc try.c
/tmp> ./a.out
Hostname = archie.rutgers.edu
Sucking mud
/tmp> exit
script done on Tue Nov 16 01:35:39 1993
--------------------------------------------------------------------------------
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
main()
{
struct hostent *host;
char name[30];
strcpy(name,"archie.rutgers.edu\0");
printf("Hostname = %s\n",name);
host = gethostbyname(name);
if (host == NULL)
{
printf ("Sucking mud\n");
exit(1);
}
printf ("Official Name = %s\n",host->h_name);
}
--------------------------------------------------------------------------------
--
+--> Filip "I'll buy a vowel" Gieszczykiewicz. | Best e-mail "fmgst+@pitt.edu"
| If you would like to receive the latest version of the SCI.ELECTRONICS FAQ,
| E-mail me and I will send you the INDEX to confirm address. Feedback Welcome!
| I live for my EE major, Windsurfing, SCA, programming, and assorted dreams.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads