From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 24 20:01:27 2007 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 475EF16A418 for ; Tue, 24 Jul 2007 20:01:27 +0000 (UTC) (envelope-from victorloureirolima@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.237]) by mx1.freebsd.org (Postfix) with ESMTP id 090C013C45A for ; Tue, 24 Jul 2007 20:01:26 +0000 (UTC) (envelope-from victorloureirolima@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so1366100nzf for ; Tue, 24 Jul 2007 13:01:26 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JMTo3j0wD1vD7saIINyyk+woi+WTa7U18KW+4StzVlTEhu2ZPXoZRZVtABOjJfpvA08BOGzaAt9tiVd2s5zkWKe/DTVqm7LctVB7WilURgbfOyEdBZW2W4K58DpBfuJPczCHqiTSt2u+wGlYOciwL26so7cEPOgmiZjnU7282P4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=U1SzaOVE7VIV33OUx/h47+6kcMxXqPXFDHKlzDS2lDT95c2AEkhuVjCiEblNKC8e/sj3zBkz1QnmkOJdnspifYdk6pgr/hOe44ZA5MoEk0JzIlTS4CPLQEsBoldIdudqKfy7riLWPPLMB/VHPWLoewGGHbdm0MU8CVYf7TxyKSo= Received: by 10.115.17.1 with SMTP id u1mr4379041wai.1185305735496; Tue, 24 Jul 2007 12:35:35 -0700 (PDT) Received: by 10.114.177.7 with HTTP; Tue, 24 Jul 2007 12:35:35 -0700 (PDT) Message-ID: Date: Tue, 24 Jul 2007 16:35:35 -0300 From: "Victor Loureiro Lima" To: "John-Mark Gurney" , "Daniel Molina Wegener" , "FreeBSD Hackers" In-Reply-To: <20070724184355.GH99491@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200707232052.58485.dmw@unete.cl> <20070724184355.GH99491@funkthat.com> Cc: Subject: Re: A few questions... 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, 24 Jul 2007 20:01:27 -0000 2007/7/24, John-Mark Gurney : > Daniel Molina Wegener wrote this message on Mon, Jul 23, 2007 at 20:52 -0400: > > a) Is there any function or variable that tells me which is the > > root user UID in the system, or root always have 0 and it's > > an "elegant" option to compare the variables or structure > > members against zero. > > #include > > uid == UID_ROOT > > > b) Can normal users look for system processes or kernel threads? > > Yes, ps does this... > ps(1) either elevates its priviledges during execution, or has some other way of medling into the afairs of other processes that will eventually need some higher priviledge status (either that, or I am really out-dated on modern operational systems) There lots of ways of finding information on other process, using libkvm was the most recent option that I saw ;) might be worth taking a look at it... victor loureiro lima