From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 9 13:06:58 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5666A106566B; Wed, 9 Nov 2011 13:06:58 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id B12518FC0A; Wed, 9 Nov 2011 13:06:57 +0000 (UTC) Received: by eyd10 with SMTP id 10so1811673eyd.13 for ; Wed, 09 Nov 2011 05:06:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=DruClOduSGVVY/u6B0NxzAYa6fBrQISTsaip8uK2/U8=; b=Xu6Qadwo1O4YSJ/F/mJ/FXQdpM6dAli/Cm4JMfj6YJdy+hqVMxJNOSGrizu3EQGyV7 NzSoHOl4zQKp1jHaqQqyWBXCxEs90l3qNAfqRsXNeBE8ygxmxm5jWqywKk49cRoqa5dY Z71oCOKorNN85uwObQgWqW50hvEeQqANz6omc= Received: by 10.213.35.210 with SMTP id q18mr1737427ebd.94.1320844014842; Wed, 09 Nov 2011 05:06:54 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id z58sm13364033eea.3.2011.11.09.05.06.51 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 05:06:52 -0800 (PST) From: Mikolaj Golub To: Kostik Belousov Organization: TOA Ukraine References: <20111031094948.GB50300@deviant.kiev.zoral.com.ua> <86vcr21agm.fsf@kopusha.home.net> <20111105135801.GT50300@deviant.kiev.zoral.com.ua> <86ehxmpogp.fsf@kopusha.home.net> <20111105154443.GB50300@deviant.kiev.zoral.com.ua> <86ehxmjsza.fsf@kopusha.home.net> <20111105194553.GK50300@deviant.kiev.zoral.com.ua> <8662iyjof9.fsf@kopusha.home.net> <20111106181041.GH50300@deviant.kiev.zoral.com.ua> <86r51iqoad.fsf@kopusha.home.net> <20111109124455.GW50300@deviant.kiev.zoral.com.ua> Sender: Mikolaj Golub Date: Wed, 09 Nov 2011 15:06:49 +0200 In-Reply-To: <20111109124455.GW50300@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Wed, 9 Nov 2011 14:44:55 +0200") Message-ID: <864nydigwm.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org, Robert Watson Subject: Re: "ps -e" without procfs(5) 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: Wed, 09 Nov 2011 13:06:58 -0000 On Wed, 9 Nov 2011 14:44:55 +0200 Kostik Belousov wrote: KB> On Tue, Nov 08, 2011 at 11:47:54PM +0200, Mikolaj Golub wrote: >> >> http://people.freebsd.org/~trociny/env.sys.4.patch >> >> Investigating cases when EFAULT was returned and if the fallback was >> successful I noticed that most of the cases were when p->p_comm changed during >> the read, so the process was in exec in that time. In order to avoid this >> error I added a check for P_INEXEC flag. KB> And now you return success and nothing gets copied out for the process KB> in P_INEXEC state. This looked ok for me: new arguments have not been created for the process yet, so return nothing :-) KB> Either you should return an error like EAGAIN, or consider the P_INEXEC KB> state as transitional and wait till process leaves it. Or, ignore the KB> state as it was before, and return whatever error proc_rwmem generated KB> (my preference). I prefer EAGAIN :-). Reading in the process space that is being currrently updated does not look good for me. And EAGAIN gives a hint that if I try it again I will probably get the result, while EFAULT looks mysterious. -- Mikolaj Golub