From owner-freebsd-arch@FreeBSD.ORG Mon Jun 5 07:45:01 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 63FF516A41F for ; Mon, 5 Jun 2006 07:45:01 +0000 (UTC) (envelope-from guomingyan@gmail.com) Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9F8843D48 for ; Mon, 5 Jun 2006 07:45:00 +0000 (GMT) (envelope-from guomingyan@gmail.com) Received: by wx-out-0102.google.com with SMTP id i31so688182wxd for ; Mon, 05 Jun 2006 00:44:58 -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:mime-version:content-type; b=aSxaR8bDLERhuuBQ7S71crYyTGTc8N35xzIQtfL8x2qOuCw2sFystUv43ZbxXepKVPQOhnkuornv371raUXFJPAv/5Ug4Et1Vrb94dejlXmNS4qRdANC+uwESd4y3lxpBhUibJAp9QgRSw5MVZEaPkmylV1s6859Xuvol3NJ8DA= Received: by 10.70.14.9 with SMTP id 9mr5764103wxn; Mon, 05 Jun 2006 00:44:58 -0700 (PDT) Received: by 10.70.39.18 with HTTP; Mon, 5 Jun 2006 00:44:58 -0700 (PDT) Message-ID: <1fa17f810606050044k2847e4a2i150eb934ed84006f@mail.gmail.com> Date: Mon, 5 Jun 2006 15:44:58 +0800 From: MingyanGuo To: freebsd-arch@freebsd.org MIME-Version: 1.0 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: 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 07:45:01 -0000 Hi all, I find that FreeBSD Syscalls always have an `thread' argument, for example, preadv(/sys/kern/sys_generic.c) has a `td' argument. But some Syscalls may rarely use this argument, and thay ( and functions they invoke) can get the `thread' who make the Syscall _easily_ via `curthread' macro if needed. So the `thread' argument seems not needed. Can anybody tell me why use `thread' as an argument of Syscalls? Thanks. Regards, -- 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