From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 17 07:06:28 2008 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 ECF20106566B for ; Thu, 17 Jul 2008 07:06:28 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by mx1.freebsd.org (Postfix) with ESMTP id 770298FC14 for ; Thu, 17 Jul 2008 07:06:27 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so4009879fgb.35 for ; Thu, 17 Jul 2008 00:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=PE2MjYvLgGszagO7dxgbij3ALBS/4SJ3YovBH9eVlvs=; b=PGHKCLsT4Me2yDZbiJ/7b1XtieR3bvgcbMo9Xk56nOpuyIWupDPrw1VqO9BnHZK2I5 veGsiFVj4DnS2yU1MfvDKOcPkaxMgY3alDRvyivY6ZdtOXL9pZnDZjPxKn/ePOQ79m0B cbR2K3Vb2G/4kHJyfnJnin+pwA7UKJt+j3Yo8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ExSvKOzRzAaYykqqlDbqS86+6XQT7lEeg3YiPhC3Z8P6QxxcF21tYU0IjaSUs5gre/ h9l4WbusaOq6w8AOHDYd3/F5AeSWSTp/x2AHcvE39nK3WmpPmQwvSwrYxEFSstih2i5c uJ84sxICKN+XECOTUlw4ddpVsv9m5tEJFb0X8= Received: by 10.86.28.2 with SMTP id b2mr3437038fgb.20.1216278386786; Thu, 17 Jul 2008 00:06:26 -0700 (PDT) Received: by 10.86.3.17 with HTTP; Thu, 17 Jul 2008 00:06:26 -0700 (PDT) Message-ID: <1bd550a00807170006m2c5f0be5u24ebe34df74a38ac@mail.gmail.com> Date: Thu, 17 Jul 2008 09:06:26 +0200 From: "=?ISO-8859-1?Q?Fernando_Apestegu=EDa?=" To: "=?ISO-8859-1?Q?Marc_L=F6rner?=" In-Reply-To: <200807170829.55210.marc.loerner@hob.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <002d01c8e79e$200078d0$60016a70$@de> <200807170829.55210.marc.loerner@hob.de> Cc: freebsd-hackers@freebsd.org Subject: Re: reading a file in kernelmode 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, 17 Jul 2008 07:06:29 -0000 On 7/17/08, Marc L=F6rner wrote: > Hello David! > > On Thursday 17 July 2008 01:46, David wrote: > > Hello, > > > > > > > > I'm developing a FreeBSD kernel module and I'm searching for a good > > solution to open/read/close a file. > > > > My goal is to generate a MD5-Hash of a given file (path). > > > > > > > > Open-Syscall seems to be improper. > > > > > > > > Any ideas/solutions/examples? > > > > Look at file kern/kern_ktrace.c at the use of vn_open in function > ktrace(td, uap) and VOP_WRITE in function > ktr_writerequest(struct thread *td, struct ktr_request *req) > > I think reading is done quite analogue to writing in case above. Hi, I'm just curious, is it proper to read a file from kernel space? Is it something the kernel is supposed to do? Thanks in advance. > > HTH, > Marc > _______________________________________________ > 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= " >