[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#564232: bind behaviour different between linux and freebsd ?

The following C code give different results on kfreebsd amd64 on one side
and sparc/powerpc/ on the other side
for kfreebsd amd64 :
xavier@debian:~$ ./bind_socket_c 
sin len 16
res -1
for sparc :
./xavier@canis-latrans:~$ ./bind_socket_c 
sin len 16
res 0
for powerpc :
xavier@power5:~$ ./bind_socket_c 
sin len 16
res 0
code used :
xavier@debian:~$ cat bind_socket_c.c

int main ()
 int socket_fd;
 struct sockaddr_in sin;
 int len,res;

 len = sizeof (struct sockaddr_in);
 memset (&sin, 0, len);

 sin.sin_port = 5786;

 printf ("sin len %d\n",len);
 socket_fd = socket (AF_INET,SOCK_STREAM,0);
 res = bind (socket_fd, &sin, len);

 printf ("res %d\n",res);

 return 0;

problem doesn't seem any more specific to Ada ?

Reply to: