From owner-freebsd-arch@FreeBSD.ORG Mon Jun 5 16:30:12 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8365416A621 for ; Mon, 5 Jun 2006 16:30:12 +0000 (UTC) (envelope-from guomingyan@gmail.com) Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C73443D46 for ; Mon, 5 Jun 2006 16:30:11 +0000 (GMT) (envelope-from guomingyan@gmail.com) Received: by wx-out-0102.google.com with SMTP id i31so764533wxd for ; Mon, 05 Jun 2006 09:30:10 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=GMC0wzuZccG4viavKp6iZWVlzk+rW3Ae5FSDht3A3tOzedL3Cy9dF9t1uamOPMaUuW9BY5APo2XpmQWfO7qYq5hOvDoqr+GeivOMjkgwGsjsgloVgyj7ZwFIYL8LmdxuNQ2qu3jf547NwuK77xSEpSo1FNu+lSFlOKtXiNXZ3/0= Received: by 10.70.6.1 with SMTP id 1mr6277562wxf; Mon, 05 Jun 2006 09:30:10 -0700 (PDT) Received: by 10.70.39.18 with HTTP; Mon, 5 Jun 2006 09:30:09 -0700 (PDT) Message-ID: <1fa17f810606050930g407d622frd3568cf8036191b5@mail.gmail.com> Date: Tue, 6 Jun 2006 00:30:09 +0800 From: MingyanGuo To: freebsd-arch@freebsd.org In-Reply-To: <1fa17f810606050921n44da78d6y52f41279a0c1396b@mail.gmail.com> MIME-Version: 1.0 References: <1fa17f810606050044k2847e4a2i150eb934ed84006f@mail.gmail.com> <1fa17f810606050608l5bd2ec5ch37663375f6fa5b64@mail.gmail.com> <20060605163559.N50057@fledge.watson.org> <1fa17f810606050921n44da78d6y52f41279a0c1396b@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: delphij@gmail.com Subject: Re: Why use `thread' as an argument of Syscalls? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jun 2006 16:30:21 -0000 On 6/5/06, Robert Watson wrote: > > > On Mon, 5 Jun 2006, Daniel Eischen wrote: > > >> They are the same questions, I think ;-). Now would you please explain > "why > >> use `proc' as an argument of Syscalls" to me :)? I've read some > source > >> code of the kernel, but no comments about it found. > > > > I don't know. Convention? It makes sense to me. > > Certainly consistency. Most system calls do actually use the argument at > some > point -- be it to look up a file descriptor, access control, or the like, > and > the calling context has it for free and in-hand anyway. > > Robert N M Watson > Thanks for your reply. And any more reasons? I have browsed some OpenSolaris and Linux source, and find that they get the `proc'/`thread'/`task' by `curproc'/`curthread'/`current' like macros when needed, which are different from FreeBSD. So I wanna know why FreeBSD do it in this way, has some mysterious reasons;-)? or not. Thanks Regards, MingyanGuo -- Three passions, simple but overwhelmingly strong, have governed my life: the longing for love, the search for knowledge, and unbearable pity for the suffering of mankind. ---------Bertrand Russell -- Three passions, simple but overwhelmingly strong, have governed my life: the longing for love, the search for knowledge, and unbearable pity for the suffering of mankind. ---------Bertrand Russell