site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=XEEQXUAHbfyMB1a3Yng8PigT2UwELqHAPpPVwt0oq00=; b=cEqMZcvNzXaeS9H/r4mLK8TgwJkuTTS2VpSoLk/rsWuTURaK+uVMDCDyfoW5VIEzcl 0hQblcdWrocrA2exbjSM0okC90xcowkc1WSzZJBywEgKocS0wakdEXj1hcRSjhM+QVOW OX2ILZjU1KWBudBWtrsWS+0rG+OZbxMqnouag= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=bUD5ssP8KR1lCsfXVKQl+E4pxMDfABIND8YIjpQbWkKgckf86pytBMlYZEA0d8KwOp JwvOTUL/NM+RoVlcSoAdFnhcJqo/aZbo9H1IUlFB8CDLSG150Tg8cWTAaAxs9ltJM3LI bSvwhXYag8EWYR3+pb8um87nC7PNdtJ1CauT4= ./sys/errno.h:#define errno (*__error()) -Patrick On Oct 3, 2008, at 6:56 PM, Michael Andronov wrote: Hi, I am presently debugging an application, which has 2 threads: Thanks for kind attention to this matter. Michael. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/rutski89%40gmail.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Using the symbol "errno" is the right thing to do in all cases, threaded or non-threaded. This is why it's usually implemented as a macro, so that under the hood it's really a call to some OS specific function get the thread's local errno, e.g.: You're asking "how to distinguish errno (global) from errno ( thread local) on OS X 10.5 Leopard?", but I don't think that question even makes any sense; there's no such thing as a global errno, as far as I can tell. 1. First thread - TH1 - is waiting to be waked up within the function sem_wait(...) 2. Second thread - TH2 - is executing some code. Within such code, there is a call for fsync(...) function. The behavior is that if fsync() function within TH2 is failing, then TH1 is returning form sem_wait(...) with errno EBADF ( int 9). The only explanation I see is that for some reason global errno is checked within TH1 instead of thread local. The code , in C++, is compiled with `-pthread` flag, under OS X 10.5... My question is how to distinguish errno (global) from errno ( thread local) on OS X 10.5 Leopard? P.S> I have seen same posting about similar issue dated 2002, but the `fixes` seems not working on 10.5... This email sent to rutski89@gmail.com This email sent to site_archiver@lists.apple.com