Skip to content

Adding OSAL inotify - #379

Draft
MaciejKaszynski wants to merge 2 commits into
eclipse-score:mainfrom
etas-contrib:create-wait-for-osal
Draft

Adding OSAL inotify#379
MaciejKaszynski wants to merge 2 commits into
eclipse-score:mainfrom
etas-contrib:create-wait-for-osal

Conversation

@MaciejKaszynski

Copy link
Copy Markdown
Contributor

Adding an osal layer for inotify.

The INotifyWatcher is exposes an iterator that wraps the reading from the inotify event queue file, new events appear when available and things are blocked with epoll_wait so that we can sleep. This also allows for interruptions for unit tests.
(note I had to do some funky stuff with epoll for this)

Usage:

    auto res = INotifyWatcher::Create();
    auto watcher = std::move(res).value();
    auto watch = watcher.add_watch("/tmp", IN_CREATE);

    for (const INotifyEvent& event : watcher)
    {
        // will block until a new event is present
        // running touch /tmp/test will print test!
        std::cout << event.name << std::endl;
    };

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: fdf22d2b-8469-491f-a11e-e93883a5e8f2
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (43 packages loaded, 10 targets configured)

Analyzing: target //:license-check (86 packages loaded, 10 targets configured)

Analyzing: target //:license-check (132 packages loaded, 362 targets configured)

Analyzing: target //:license-check (151 packages loaded, 5345 targets configured)

Analyzing: target //:license-check (161 packages loaded, 5547 targets configured)

Analyzing: target //:license-check (161 packages loaded, 5547 targets configured)

Analyzing: target //:license-check (164 packages loaded, 7434 targets configured)

Analyzing: target //:license-check (166 packages loaded, 10194 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

INFO: Analyzed target //:license-check (169 packages loaded, 10409 targets configured).
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 25.804s, Critical Path: 2.03s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html


score::Result<INotifyWatcher> INotifyWatcher::Create() noexcept
{
int event_queue_fd = ::inotify_init1(IN_CLOEXEC);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to baselibs if eclipse-score/baselibs#420 is done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant