From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 6 12:38:23 2009 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 CEC06106564A for ; Thu, 6 Aug 2009 12:38:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9EAB98FC1F for ; Thu, 6 Aug 2009 12:38:23 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 3800C46B17; Thu, 6 Aug 2009 08:38:23 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 0777A8A0AA; Thu, 6 Aug 2009 08:38:22 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 6 Aug 2009 08:18:22 -0400 User-Agent: KMail/1.9.7 References: <319cceca0908030119i3432a495ya60aa431dab0e1b1@mail.gmail.com> <20090804093036.GN1292@hoeg.nl> <86ab2f34ay.fsf@ds4.des.no> In-Reply-To: <86ab2f34ay.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200908060818.23158.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 06 Aug 2009 08:38:22 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= , Maslan , Max Laier , Ed Schouten Subject: Re: sosend() and mbuf 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: Thu, 06 Aug 2009 12:38:24 -0000 On Tuesday 04 August 2009 12:57:25 pm Dag-Erling Sm=C3=B8rgrav wrote: > Ed Schouten writes: > > Maslan writes: > > > However, when i checked the pid & tid of the new created thread it > > > was not the same as the parent nor as the proc0 & thread0 > > I am not sure, but sharing another process's address space doesn't have > > to imply it shares the same pid, right? >=20 > The man page explicitly states that if no process is specified, the new > thread is assigned to proc0, which has a valid filedesc table, valid > creds etc., so this shouldn't be a problem. However, he's getting a > different PID, which shouldn't happen. Either the man page is wrong, or > things were different in 7. proc0 does not have a fully valid file descriptor table. It has a structur= e,=20 but fd_[cjr]dir are not initialized to point at anything. File descriptors= =20 are a property of userland processes, not of kernel processes. However,=20 fd_[cjr]dir need to be valid to perform any namei() lookup even if one is=20 simply going to do a vn_open() on the resulting vnode (which is more=20 approprate for kernel code to do, if it is to open a file at all). =2D-=20 John Baldwin