From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e2fe95e4fd8e27a8,start X-Google-Attributes: gidfee84,public From: kr Subject: bind, socket, EADDRNOTAVAIL Date: 1999/11/15 Message-ID: #1/1 X-Deja-AN: 549081372 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Complaints-To: usenet@news.cc.oberlin.edu X-Trace: news.cc.oberlin.edu 942715630 28052 132.162.140.248 (16 Nov 1999 01:27:10 GMT) Organization: Oberlin College Mime-Version: 1.0 NNTP-Posting-Date: 16 Nov 1999 01:27:10 GMT Newsgroups: comp.unix.osf.osf1 I've run into an obstacle of sorts trying to port a program to Tru64 / Digital Unix... where the program uses an internet socket to set up a listening connection on an unpriveleged port, or where it is supposed to, the bind operation is failing with errno "EADDRNOTAVAIL". Any idea as to why? (i.e. does this platform have some socket-related idiosyncrasies I'm unaware of?) Code fragment follows. ...... in_addr numeric_addr; struct sockaddr_in addr_in; ...... if ((in_port=socket(AF_INET,SOCK_STREAM,0)) < 0) { perror("socket"); exit(EXIT_FAILURE); } numeric_addr.s_addr=htonl(inet_addr("127.0.0.1")); addr_in.sin_port = 1039; /* for example */ addr_in.sin_family = PF_INET; addr_in.sin_addr = numeric_addr; if ( bind(in_port,(struct sockaddr *) & addr_in,sizeof(addr_in)) < 0) { perror("bind"); exit(EXIT_FAILURE); /* and voila! failure occurs. */ } ...... Very normal, vanilla stuff. ...I've tried running the program on two different machines, with and without root privelege; I've even tried varying the ports used, and whether or not the local host's network address is named explicitly. So I must be missing something obvious. Or perhaps there is an unknown (and unwanted) DEC security feature enabled by default on both machines, which is preventing the socket from binding as expected. Or I am the unwitting victim of a subtle, *godawful* coding gaffe. This is more-or-less textbook socket programming. So if you have an inkling what's going on, give a buzz... TIA. Katherine Russell Programmer/ Analyst, Oberlin College Development Resources russell@ais.oberlin.edu . ignore, override, become