X-Spam-Check-By: sourceware.org Date: Fri, 7 Apr 2006 01:37:31 -1000 (HST) From: Antonio Querubin To: cygwin AT cygwin DOT com Subject: getsockname problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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; 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/