From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 24 03:56:50 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FEC316A4DF for ; Thu, 24 Aug 2006 03:56:50 +0000 (UTC) (envelope-from joseph.koshy@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 29DF643D45 for ; Thu, 24 Aug 2006 03:56:43 +0000 (GMT) (envelope-from joseph.koshy@gmail.com) Received: by nz-out-0102.google.com with SMTP id 13so247394nzn for ; Wed, 23 Aug 2006 20:56:43 -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:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bnAT/aKJy3N6Ljk+/2c1HQ6Xtflu+HJ6JswopTrgRbWarK486dDUZinLqlFEU6/qHEEaFp+FW1N/3nHoQulJD8hLaJkLZ+JJ2GD7IXydED0lRchFGdrLAtpf3rRj3tGB8obsTB0NEWxu8816R+Y0jMZ1B4jtKhVN1DeBWifu1ZM= Received: by 10.65.211.16 with SMTP id n16mr1550259qbq; Wed, 23 Aug 2006 20:56:43 -0700 (PDT) Received: by 10.64.178.14 with HTTP; Wed, 23 Aug 2006 20:56:43 -0700 (PDT) Message-ID: <84dead720608232056o183976ffidc1c506434e754b9@mail.gmail.com> Date: Thu, 24 Aug 2006 09:26:43 +0530 From: "Joseph Koshy" To: "Kim Shrier" In-Reply-To: <77B636A3-5AED-41E6-AB98-91178E1D10D8@tinker.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <77B636A3-5AED-41E6-AB98-91178E1D10D8@tinker.com> Cc: FreeBSD Hackers Subject: Re: The proper way to open a file from inside the 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: Thu, 24 Aug 2006 03:56:50 -0000 > I am experimenting with modifying a kernel module and I need > to be able to open/read/write/close a file from within the > module. Is there a preferred way to do this? Are there any > locking or buffering issues that I need to be aware of? sys/kern/kern_alq.c:alq_open() and sys/kern/kern_ktrace.c:ktrace() have examples. -- FreeBSD Volunteer, http://people.freebsd.org/~jkoshy