From owner-freebsd-stable@FreeBSD.ORG Fri Jun 17 14:17:58 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 81E3D16A41C for ; Fri, 17 Jun 2005 14:17:58 +0000 (GMT) (envelope-from debiandude@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B0CF43D1D for ; Fri, 17 Jun 2005 14:17:58 +0000 (GMT) (envelope-from debiandude@gmail.com) Received: by zproxy.gmail.com with SMTP id 12so395198nzp for ; Fri, 17 Jun 2005 07:17:57 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EOq413BpjPULkN9X/ku/L3eXv/oF8rQTJxECnwwowt+KVszfhTUPiGFUAoUejVuu8T4XJVabS+gjse5kbrj7iBYZkXQzbdnhJOh5YGElluhD5ABEaZqAoycxsfD5rxP/jWeSNcpH+JNNgQqdeUigqlvajyBMv6w7+ZV9lq7HXnc= Received: by 10.36.67.15 with SMTP id p15mr1362538nza; Fri, 17 Jun 2005 07:17:57 -0700 (PDT) Received: by 10.36.3.13 with HTTP; Fri, 17 Jun 2005 07:17:57 -0700 (PDT) Message-ID: Date: Fri, 17 Jun 2005 16:17:57 +0200 From: Hannes Mayer To: freebsd-stable@freebsd.org, Daniel O'Connor In-Reply-To: <200506172159.34920.doconnor@gsoft.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200506172159.34920.doconnor@gsoft.com.au> Cc: Subject: Re: Kernel module/IPC with userland: create and write to FIFO X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Hannes Mayer List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2005 14:17:58 -0000 G'Day Daniel! On 6/17/05, Daniel O'Connor 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.