mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dan Williams" <dan.j.williams@intel.com>
To: "Timur Tabi" <timur@freescale.com>
Cc: linux-kernel@vger.kernel.org, "Kumar Gala" <kumar.gala@freescale.com>
Subject: Re: Best method for sending messages to user space?
Date: Tue, 21 Oct 2008 13:16:04 -0700	[thread overview]
Message-ID: <e9c3a7c20810211316i13610410h5ec022b55c248c6a@mail.gmail.com> (raw)
In-Reply-To: <48FE30D8.6050705@freescale.com>

On Tue, Oct 21, 2008 at 12:43 PM, Timur Tabi <timur@freescale.com> wrote:
> Dan Williams wrote:
>
>> I really like the sysfs_notify() approach that Neil Brown has put
>> together for delivering md-raid events.
>
> Is there any documentation for sysfs_notify?  It doesn't appear to do anything
> whenever I call it.
>

It simply allows you to write an event loop in userspace using a sysfs
attribute file descriptor.  Pseudo-example:

fd = open("/sys/block/md0/md/array_state");
do {
	read(buf, fd, len);
	act_on_message(buf);
	select(...); /* wait for next sysfs_notify event */
	lseek(fd, 0, SEEK_SET); /* seek back so we can read the new state */
} while (1);

  reply	other threads:[~2008-10-21 20:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 17:54 Timur Tabi
2008-10-21 18:14 ` Dan Williams
2008-10-21 19:43   ` Timur Tabi
2008-10-21 20:16     ` Dan Williams [this message]
2008-10-21 20:23       ` Timur Tabi
2008-10-21 20:42         ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e9c3a7c20810211316i13610410h5ec022b55c248c6a@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --cc=kumar.gala@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=timur@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®