{"id":19061966,"url":"https://github.com/illiliti/libdemi","last_synced_at":"2026-01-17T01:14:32.414Z","repository":{"id":43196390,"uuid":"416012975","full_name":"illiliti/libdemi","owner":"illiliti","description":"Device enumeration, monitoring and introspecting library","archived":false,"fork":false,"pushed_at":"2022-03-28T17:48:04.000Z","size":116,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-09T00:29:13.713Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/illiliti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-11T16:52:27.000Z","updated_at":"2022-05-30T10:10:11.000Z","dependencies_parsed_at":"2022-08-30T10:40:43.269Z","dependency_job_id":null,"html_url":"https://github.com/illiliti/libdemi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/illiliti/libdemi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illiliti%2Flibdemi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illiliti%2Flibdemi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illiliti%2Flibdemi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illiliti%2Flibdemi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/illiliti","download_url":"https://codeload.github.com/illiliti/libdemi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illiliti%2Flibdemi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28491190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"ssl_error","status_checked_at":"2026-01-17T00:43:11.982Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T00:23:59.081Z","updated_at":"2026-01-17T01:14:32.398Z","avatar_url":"https://github.com/illiliti.png","language":"C","funding_links":[],"categories":["systemd-udev"],"sub_categories":[],"readme":"# libdemi\n\n**!!! EXPERIMENTAL !!!**\n\nDevice enumeration, monitoring and introspecting library\n\n## Showcase\n\n```c\n#include \u003cdemi.h\u003e\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n#include \u003cunistd.h\u003e\n\nint main(void)\n{\n    // Initialize demi file descriptor with no/zero flags.\n    // Optionally, DEMI_CLOEXEC and DEMI_NONBLOCK can be bitwise ORed in flags\n    // to atomically set close-on-exec flag and nonblocking mode respectively.\n    int fd = demi_init(0);\n\n    if (fd == -1) {\n        return EXIT_FAILURE;\n    }\n\n    struct demi_event de;\n\n    // Read pending event. This call will block since DEMI_NONBLOCK was not set.\n    while (demi_read(fd, \u0026de) != -1) {\n        // de_devname might not contain devname, indicating that the event shall be ignored.\n        if (de.de_devname[0] == '\\0') {\n            continue;\n        }\n\n        // Prepend /dev/ to devname, so that we have full path to devnode.\n        char devnode[sizeof(de.de_devname) + sizeof(\"/dev/\")];\n        snprintf(devnode, sizeof(devnode), \"/dev/%s\", de.de_devname);\n\n        // Print devnode and code of event type.\n        printf(\"%s (code %d)\\n\", devnode, de.de_type);\n    }\n\n    // Do not forget to close file descriptor when you are done.\n    close(fd);\n    return EXIT_SUCCESS;\n}\n```\n\n## See also\n\nhttps://github.com/illiliti/kiss-libdemi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filliliti%2Flibdemi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filliliti%2Flibdemi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filliliti%2Flibdemi/lists"}