From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20478 invoked by alias); 19 Nov 2003 23:37:11 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 20467 invoked from network); 19 Nov 2003 23:37:10 -0000 Received: from unknown (HELO outbound.ea.com) (159.153.6.29) by sources.redhat.com with SMTP; 19 Nov 2003 23:37:10 -0000 Received: from eahq-bh2.rws.ad.ea.com (eahq-bh2.rws.ad.ea.com [10.14.204.33]) by outbound.ea.com (Switch-3.1.3/Switch-3.1.0) with ESMTP id hAJNbGMJ028282; Wed, 19 Nov 2003 15:37:16 -0800 (PST) Received: from maxis-mb1.max.ad.ea.com ([10.24.4.47]) by eahq-bh2.rws.ad.ea.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 19 Nov 2003 15:37:03 -0800 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [pthreads-win32] How can you use errno with pthreads DLL? X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Date: Wed, 19 Nov 2003 23:37:00 -0000 Message-ID: <9D3D7CEF3A236243AF0335652672E348027AEB6F@maxis-mb1.max.ad.ea.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Pedriana, Paul" To: "Mark Weaver" , X-OriginalArrivalTime: 19 Nov 2003 23:37:03.0948 (UTC) FILETIME=[0967A0C0:01C3AEF6] X-SW-Source: 2003/txt/msg00141.txt.bz2 >>1. Recompile pthreads against the same runtime=20 >>library that you are using rather than MSVC.=20=20 >>This is more than likely the best solution as=20 >>having two different CRTs is nasty bloat: think=20 >>two separate heaps and copies of all support data=20 >>structure, not to mention the additional code size. This is a good idea which would work. I might point out that=20 we don't use the CRT for the most part; it is somewhat non-portable (can't rely on half of the useful stuff existing elsewhere) and not necessarily very efficient (with some exceptions),=20 and we need both. So duplicating CRTs really has little ill=20 effect for us. Also, VC++ no longer uses its own heap but=20 rather redirects all allocations to the OS under WinXP and=20 later OSs.=20 >>2. Explicitly import and use the function "_errno"=20 >>from MSVCRT.DLL. OK, this is a good idea too. I was just hoping that pthreads=20 could simply make such a thing available itself, as IMO it is=20 not a good idea for a utility library to force the apps that=20 use it to use a particular library configuration (in particular one that has a history of causing problems for commercial software developers due to problems with that way Windows deals with linked libraries). What happens if I have another DLL from somebody=20 else that has the exact opposite requirement (must use own CRT=20 and not shared one)?=20 >>sem_* and sched_* do, so if you don't use those you=20 >>could bypass this problem. Yah, it's the semaphore functions that write to errno and the ones that are an issue for me. I thought I read somewhere that there was a proposal to migrate sem_* to return error values and zero upon=20 OK, but that's another story. Thanks so much for the response. I will find a way to do one of the=20 above or add my own GetErrno function to my copy of pthreads. I find that pthreads-win32 is a great thing and am very grateful for the=20 work that has been put into it.