From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 27 19:03:09 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B58916A4CF for ; Fri, 27 Apr 2007 19:03:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 5FF1813C465 for ; Fri, 27 Apr 2007 19:03:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l3RJ2wSU086294; Fri, 27 Apr 2007 15:03:02 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Marc =?iso-8859-1?q?L=F6rner?= Date: Fri, 27 Apr 2007 11:51:54 -0400 User-Agent: KMail/1.9.6 References: <200704261408.19885.marc.loerner@hob.de> <200704261349.35661.jhb@freebsd.org> <200704270843.16908.marc.loerner@hob.de> In-Reply-To: <200704270843.16908.marc.loerner@hob.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200704271151.54720.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 27 Apr 2007 15:03:02 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3172/Fri Apr 27 10:49:40 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.1 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00, DATE_IN_PAST_03_06 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: Usage of kern_* functions in kernel 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: Fri, 27 Apr 2007 19:03:09 -0000 On Friday 27 April 2007 02:43:16 am Marc L=F6rner wrote: > On Thursday 26 April 2007 19:49, John Baldwin wrote: > > On Thursday 26 April 2007 08:08:19 am Marc L=F6rner wrote: > > > Hello, > > > I googled but found nothing about the usage of the kern_* functions > > > (kern_open, kern_close, kern_pwritev, kern_preadv) that are located in > > > vfs_syscalls.c > > > > > > When I use kern_open to open a file within the kernel, I get an error. > > > When I use the normal vn_open function instead, all works well. > > > > > > So my question is which functions are recommended by you kernel-hacke= rs > > > for use within kernelspace? > > > > > > And here a second question: Is it possible to open/use the console=20 driver > > > in kernelspace within the functions mentioned above? > > > If not, can you give me some pointers on where I can find this > > > information! > > > > kern_XXX are generally used by system calls such as alternative ABIs, e= tc. >=20 > so, you would recommend using the vn_* functions instead? In general userland should open files rather than the kernel. =2D-=20 John Baldwin