From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 4 16:40:15 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 61B0510656CD for ; Tue, 4 Aug 2009 16:40:15 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outL.internet-mail-service.net (outl.internet-mail-service.net [216.240.47.235]) by mx1.freebsd.org (Postfix) with ESMTP id 3EF6A8FC2E for ; Tue, 4 Aug 2009 16:40:15 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 054F8A300F; Tue, 4 Aug 2009 09:40:15 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 810222D6011; Tue, 4 Aug 2009 09:40:14 -0700 (PDT) Message-ID: <4A786482.4060609@elischer.org> Date: Tue, 04 Aug 2009 09:40:34 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Maslan References: <319cceca0908030119i3432a495ya60aa431dab0e1b1@mail.gmail.com> <86fxc84ksj.fsf@ds4.des.no> <200908040138.14743.max@love2party.net> <319cceca0908040227hf9a0f92jbf05b11e9f974994@mail.gmail.com> <20090804093036.GN1292@hoeg.nl> <319cceca0908040239k2accd7fen402db4c91687a267@mail.gmail.com> <20090804094142.GO1292@hoeg.nl> <319cceca0908040252w105d3dfdge9dec3c8b6d28607@mail.gmail.com> <20090804095650.GP1292@hoeg.nl> <319cceca0908040259q4537db80uc2ce9696f30bfc12@mail.gmail.com> <319cceca0908040319x35bc8bcy7a869dd230419a50@mail.gmail.com> In-Reply-To: <319cceca0908040319x35bc8bcy7a869dd230419a50@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Ed Schouten , FreeBSD Hackers 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: Tue, 04 Aug 2009 16:40:16 -0000 Maslan wrote: > OpenKETA has its own kthread_create() with a little modification from > kthread_create(), it associates the new thread with curthread not with > the thread0. hey that's horrible... (overiding a kernel symbol) > > See /usr/sys/kern/kern_kthread.c: kthread_create() > error = fork1(&thread0, RFMEM | RFFDG | RFPROC | RFSTOPPED | flags, > pages, &p2); > OpenKETA:kthread_create() > error = fork1(curthread, RFFDG | RFPROC | RFSTOPPED | flags, > pages, &p2); in 8.0 you can do this.. (see man kthread) > > I'll give it a try and see if it works. > BUT i still can't understand why kern_open() don't work, except in the > original thread. > > On Tue, Aug 4, 2009 at 9:59 AM, Maslan wrote: >> yes kio http://people.freebsd.org/~pjd/misc/kernio/ >> However, It's outdated. >> >> On Tue, Aug 4, 2009 at 9:56 AM, Ed Schouten wrote: >>> * Maslan wrote: >>>>> Is it possible to call kern_open() from within a kernel thread anyway? >>>> I think yes, It worked on the parent thread before creating a new kthread. >>>> See OpenKETA source, its using the same approach. >>>>> kern_open() depends on a file descriptor table, right? >>>> Yes, it returns a fd in the curthread->td_retval[0], which i should >>>> use within the same thread to deal with this file. >>> Didn't someone (Jeff Roberson?) develop some nice in-kernel API for >>> accessing files some years ago? Why not use that? >>> >>> -- >>> Ed Schouten >>> WWW: http://80386.nl/ >>> > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"