Mail Archives: cygwin/2006/04/07/07:37:40
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 <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
int main() {
struct sockaddr_in sa;
socklen_t len = sizeof sa;
int s, rc;
s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
printf("socket = %d\nlength = %d\n", s, len);
rc = getsockname(s, (struct sockaddr *) &sa, &len);
printf("getsockname rc = %d\nreturned length = %d\n", rc, len);
perror("getsockname");
return rc;
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -