Re: getsockname problem

2006-04-11 Thread Corinna Vinschen
On Apr 7 17:56, Antonio Querubin wrote: > On Fri, 7 Apr 2006, Dave Korn wrote: > > > Should have read the man page instead! > > > >> s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); > >> printf("socket = %d\nlength = %d\n", s, len); > >> > >> rc = getsockname(s, (struct sockaddr *) &sa, &len);

RE: getsockname problem

2006-04-07 Thread Antonio Querubin
On Fri, 7 Apr 2006, Dave Korn wrote: Should have read the man page instead! s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); printf("socket = %d\nlength = %d\n", s, len); rc = getsockname(s, (struct sockaddr *) &sa, &len); http://www.opengroup.org/onlinepubs/007908799/xns/getsockname

Re: getsockname problem

2006-04-07 Thread Antonio Querubin
On Fri, 7 Apr 2006, Reid Thompson wrote: well,,, not 'any' other linux system... $ ./getsockname socket = -1 length = 16 getsockname rc = -1 returned length = 16 getsockname: Bad file descriptor That points out an error in getting the raw socket, not in getsockname() itself. getsockname() c

RE: getsockname problem

2006-04-07 Thread Dave Korn
On 07 April 2006 12:38, Antonio Querubin wrote: > I've run into a problem where getsockname() doesn't work as expected. > Below is a test program where it fails under cygwin but runs on any other > Unix/Linux system. I searched the mail archives for any limitations Should have read the man pag

Re: getsockname problem

2006-04-07 Thread Reid Thompson
Antonio Querubin wrote: I've run into a problem where getsockname() doesn't work as expected. Below is a test program where it fails under cygwin but runs on any other Unix/Linux system. I searched the mail archives for any limitations #include #include #include #include int main() {

getsockname problem

2006-04-07 Thread Antonio Querubin
I've run into a problem where getsockname() doesn't work as expected. Below is a test program where it fails under cygwin but runs on any other Unix/Linux system. I searched the mail archives for any limitations #include #include #include #include int main() { struct sockaddr_in sa;