From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 3 03:23:40 2012 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9E2F1065670 for ; Tue, 3 Jul 2012 03:23:40 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id B04888FC08 for ; Tue, 3 Jul 2012 03:23:40 +0000 (UTC) Received: from eagle.yuri.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id q633NYHp002772; Mon, 2 Jul 2012 20:23:39 -0700 (PDT) (envelope-from yuri@rawbw.com) Message-ID: <4FF265B3.8050301@rawbw.com> Date: Mon, 02 Jul 2012 20:23:31 -0700 From: Yuri User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120702 Thunderbird/13.0.1 MIME-Version: 1.0 To: Alexander Kabaev References: <4FEE0D2F.4010808@rawbw.com> <20120702183232.037dda59@kan.dyndns.org> In-Reply-To: <20120702183232.037dda59@kan.dyndns.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org Subject: Re: System is flooded with failed read(2) calls: Resource temporarily unavailable (errno=35) coming from xorg unix socket X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2012 03:23:40 -0000 On 07/02/2012 15:32, Alexander Kabaev wrote: > Pardon my possibly naive question, but isn't using errno to detect > whether the syscall is succesful a wrong techique? Syscall will NOT > change errno unless unless it actually failed, so unless dtrace's errno > emulation is more magic than I thought, your script will mistakenly > attribute error code coming from a distant past to syscalls just > complete with no errors? I didn't think about this at all, just picked this script from some website. But now I did an experiment: in the test process I placed on failing open(2) call and next to it a succeeding one. And this dtrace script only shows one failed open(2) call, not two as you would expect if errno was indeed preserved between them. So maybe there is some magic to it in dtrace functionality. Someone more familiar with the matter maybe can explain this. Yuri