Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* bind, socket, EADDRNOTAVAIL
@ 1999-11-15  5:00 kr
  1999-11-15  5:00 ` kr
  1999-11-18  5:00 ` Gerard Gobillard
  0 siblings, 2 replies; 3+ messages in thread
From: kr @ 1999-11-15  5:00 UTC (permalink / raw)


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 




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-11-18  5:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-11-15  5:00 bind, socket, EADDRNOTAVAIL kr
1999-11-15  5:00 ` kr
1999-11-18  5:00 ` Gerard Gobillard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox