Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Feb 2005 04:58:23 +0000
From:      Joseph Koshy <joseph.koshy@gmail.com>
To:        Ashwin Chandra <ashcs@ucla.edu>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Opening and wriiting to file in Kern
Message-ID:  <84dead720502062058551f61c2@mail.gmail.com>
In-Reply-To: <4206008F.2060100@freebsd.org>
References:  <001301c50c3e$1a8003b0$58e243a4@ash> <4206008F.2060100@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> If you mist do this, the general set of steps are:
> 
> 1. use namei() to convert a pathname to a vnode
> 2. Use vn_open(), vn_rdwr(), and vn_close() to operate on the vnode.
> 3. Observe proper vnode locking and reference counting with vref(),
> vn_lock(), and vput()

Take a look at "sys/kern/kern_ktrace.c" or "sys/kern/kern_alq.c" for a template.

-- 
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84dead720502062058551f61c2>