From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA630EB64D8 for ; Tue, 13 Jun 2023 22:25:29 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.96) (envelope-from ) id 1q9CRK-0000Vq-1x; Tue, 13 Jun 2023 18:24:38 -0400 Received: from mail1.systemli.org ([2a11:7980:3::36]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1q9CRI-0000RG-23 for kernelnewbies@kernelnewbies.org; Tue, 13 Jun 2023 18:24:36 -0400 Message-ID: <75b43ee7-1f29-e5a2-f405-e2acc5c3b794@systemli.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=systemli.org; s=default; t=1686695055; bh=fkVawUF/h2zPmNjiY9smljmHOuD41bi1Ra8if/UNW04=; h=Date:Subject:From:To:References:In-Reply-To:From; b=uy0gdoc1k9WCzU572yw1Zf6HgAv32RxtbzzoVGM0kPlFXhOmj10p/9dJsSPzm4ino a/0eobu6S90hg/+0HwgMA6Z/CIskZJS0qubFTglkDzlJFHohpTGW4H3OeIch//o131 YZah6nTEvt2vv8KqntRtczKk24KrzRB/XJADWKcSR3x0IO69b01QFgkrPFEcxVyO+7 xZUvCZtHvwIwdGsWC+eq6zKSIYbWm7/49i0nJjvAYQDOJNHsLQAwIw4Kn6zhJAURdg Fy1RE3IYzDYoIj/nrfUefXHXMiAbpfBihhu5cds4V5KeyYuXnSDFhP3c8UQoHWeKmI GVySXeMc8ASbw== Date: Wed, 14 Jun 2023 00:24:14 +0200 MIME-Version: 1.0 Subject: Re: Watching for new files/symlinks/devices in sysfs (possible? which syscall?) Content-Language: en-US From: Richard To: kernelnewbies References: <8e4d3659-65da-0eff-0826-8ba86bdfab19@systemli.org> In-Reply-To: <8e4d3659-65da-0eff-0826-8ba86bdfab19@systemli.org> X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kernelnewbies-bounces@kernelnewbies.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