Opening and wriiting to file in Kern

2005-02-06 Thread Ashwin Chandra
Does anyone know the correct calls to open a file, write to it, and close it, IN *kernel* mode. Ash ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL

Re: Opening and wriiting to file in Kern

2005-02-06 Thread Scott Long
Ashwin Chandra wrote: Does anyone know the correct calls to open a file, write to it, and close it, IN *kernel* mode. Ash There is no common API for doing this, which is pretty much on purpose. First, you need to ask yourself why your task needs it done in the kernel and not in userland. If

Re: Opening and wriiting to file in Kern

2005-02-06 Thread Kamal R. Prasad
--- Scott Long [EMAIL PROTECTED] wrote: Ashwin Chandra wrote: Does anyone know the correct calls to open a file, write to it, and close it, IN *kernel* mode. Ash There is no common API for doing this, which is pretty much on purpose. First, you need to ask yourself why your

Re: Opening and wriiting to file in Kern

2005-02-06 Thread Peter Pentchev
On Sun, Feb 06, 2005 at 04:22:41AM -0800, Kamal R. Prasad wrote: --- Scott Long [EMAIL PROTECTED] wrote: Ashwin Chandra wrote: Does anyone know the correct calls to open a file, write to it, and close it, IN *kernel* mode. Ash There is no common API for doing this,

Re: Opening and wriiting to file in Kern

2005-02-06 Thread Robert Watson
On Sun, 6 Feb 2005, Ashwin Chandra wrote: Does anyone know the correct calls to open a file, write to it, and close it, IN *kernel* mode. I fyou want to be file system independent, you can currently do it using two different currently available kernel abstractions: - VFS interface. Using

Re: Opening and wriiting to file in Kern

2005-02-06 Thread Kamal R. Prasad
--- Peter Pentchev [EMAIL PROTECTED] wrote: On Sun, Feb 06, 2005 at 04:22:41AM -0800, Kamal R. Prasad wrote: --- Scott Long [EMAIL PROTECTED] wrote: Ashwin Chandra wrote: [snip] facility. I don't see anything wrong with providing a stream (like) interface to the filesystem.

Re: Opening and wriiting to file in Kern

2005-02-06 Thread Joseph Koshy
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