Kernel Newbies archive mirror
 help / color / mirror / Atom feed
From: Richard <richard_siegfried@systemli.org>
To: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: Watching for new files/symlinks/devices in sysfs (possible? which syscall?)
Date: Wed, 14 Jun 2023 00:24:14 +0200	[thread overview]
Message-ID: <75b43ee7-1f29-e5a2-f405-e2acc5c3b794@systemli.org> (raw)
In-Reply-To: <8e4d3659-65da-0eff-0826-8ba86bdfab19@systemli.org>

Update (because someone asked):

udev is no viable alternative.
We tried it with udev, it's too slow. It's about an embedded device 
where time is of essence.
And we made some measurements, even simply polling with a python script 
in /sys/ is over a second faster than waiting for udev.

-- Richard


On 13.06.23 23:31, Richard wrote:
> Hi,
> is there a possibility, in sysfs, to watch for new symlinks (i.e. 
> devices) beeing added to /sys/bus/usb/devices (like with inotify for 
> normal directories)?
> 
> I know you can use select() (userspace) and sysfs_notify() (kernelspace) 
> for attributes , but is there something for folders and new devices (or 
> symlinks)?
> 
> Thanks,
> -- Richard
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

      reply	other threads:[~2023-06-13 22:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13 21:31 Watching for new files/symlinks/devices in sysfs (possible? which syscall?) Richard
2023-06-13 22:24 ` Richard [this message]

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=75b43ee7-1f29-e5a2-f405-e2acc5c3b794@systemli.org \
    --to=richard_siegfried@systemli.org \
    --cc=kernelnewbies@kernelnewbies.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).