From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4508 invoked by alias); 14 Apr 2004 10:43:23 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 4475 invoked from network); 14 Apr 2004 10:43:21 -0000 Received: from unknown (HELO smtp3.hknet.com) (202.67.240.16) by sources.redhat.com with SMTP; 14 Apr 2004 10:43:21 -0000 Received: from em.no-ip.com (vp187108.hk.uac65.hknet.com [203.169.187.108]) by smtp3.hknet.com (Postfix) with ESMTP id 58FC77F77A for ; Wed, 14 Apr 2004 18:43:19 +0800 (HKT) Received: from emnb (emnb [192.168.0.2]) by em.no-ip.com (8.11.6/8.8.7) with SMTP id i3EAhDi29321 for ; Wed, 14 Apr 2004 18:43:13 +0800 Message-ID: <00c901c4220d$47f6eaa0$0200a8c0@em.noip.com> From: "Enzo Michelangeli" To: Subject: 1.5.9-1: socket() appears NOT to be thread-safe Date: Wed, 14 Apr 2004 10:43:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-SW-Source: 2004-04/txt/msg00477.txt.bz2 While porting to Cygwin the Linux application "sipd" (http://www.sxdesign.com/index.php?page=developer&submnu=sipd ), which uses pthreads, I noticed that socket() calls issued concurrently by several threads often failed, with strerror(errno) saying "operation not permitted". Once I protected all the calls with mutex locks, such errors went away. Is Cygwin's implementation of socket() known to be thread-unsafe? Enzo P.S. I have written an implementation of the missing gethostbyname_r(), based on a mutex-protected call to gethostbyname(). If useful, I may gladly contribute the code. -- 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/