Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2005 16:17:57 +0200
From:      Hannes Mayer <debiandude@gmail.com>
To:        freebsd-stable@freebsd.org, Daniel O'Connor <doconnor@gsoft.com.au>
Subject:   Re: Kernel module/IPC with userland: create and write to FIFO
Message-ID:  <bedc2e380506170717b6acef6@mail.gmail.com>
In-Reply-To: <200506172159.34920.doconnor@gsoft.com.au>
References:  <bedc2e38050617050624a7ff2e@mail.gmail.com> <200506172159.34920.doconnor@gsoft.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
G'Day Daniel!

On 6/17/05, Daniel O'Connor <doconnor@gsoft.com.au> wrote:
> On Fri, 17 Jun 2005 21:36, Hannes Mayer wrote:
> > To cut a long story short, how can I open a FIFO in kernel space and
> > write to it, so I can open and read from it in userspace ?
>=20
> Why don't you create a device node?
>=20
> If you read and write to it, it acts like a FIFO.

Thanks for your reply! :-)

Well, the reason why I want to use a true FIFO is, that data is
sampled i.e. every second and I want to write it to disk in userspace
only every minute or so. So if I add a ".d_ioctl" to "struct cdevsw"
for the device node, I have to make a function in the kernel module
for handling the userspace read request and I have to cache the
sampled data in the kernel module. I want the module to be flexible,
so if I don't sample at a fixed frequency (i.e. event counting) I
don't know how much data is coming in in a certain time interval and
with a FIFO  I don't have to care about the data-cache size.

Thanks again & best regards,
Hannes.



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