{"action":"created","issue":{"url":"https://api.github.com/repos/carllerche/nix-rust/issues/186","labels_url":"https://api.github.com/repos/carllerche/nix-rust/issues/186/labels{/name}","comments_url":"https://api.github.com/repos/carllerche/nix-rust/issues/186/comments","events_url":"https://api.github.com/repos/carllerche/nix-rust/issues/186/events","html_url":"https://github.com/carllerche/nix-rust/pull/186","id":104798661,"number":186,"title":"Add signalfd support","user":{"login":"alex-gulyas","id":8698329,"avatar_url":"https://avatars.githubusercontent.com/u/8698329?v=3","gravatar_id":"","url":"https://api.github.com/users/alex-gulyas","html_url":"https://github.com/alex-gulyas","followers_url":"https://api.github.com/users/alex-gulyas/followers","following_url":"https://api.github.com/users/alex-gulyas/following{/other_user}","gists_url":"https://api.github.com/users/alex-gulyas/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-gulyas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-gulyas/subscriptions","organizations_url":"https://api.github.com/users/alex-gulyas/orgs","repos_url":"https://api.github.com/users/alex-gulyas/repos","events_url":"https://api.github.com/users/alex-gulyas/events{/privacy}","received_events_url":"https://api.github.com/users/alex-gulyas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-03T23:05:49Z","updated_at":"2015-09-04T21:42:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/carllerche/nix-rust/pulls/186","html_url":"https://github.com/carllerche/nix-rust/pull/186","diff_url":"https://github.com/carllerche/nix-rust/pull/186.diff","patch_url":"https://github.com/carllerche/nix-rust/pull/186.patch"},"body":"This PR adds support for `signalfd`, a Linux exclusive method to receive signals via a file descriptor.\r\n\r\nAlso includes:\r\n- added support for blocking signals in `sys::signal`: `signalfd` requires blocking the signals from their normal signal handlers\r\n- added some helper functions to `sys::signal::SigSet`: querying set membership, signal blocking helpers, etc...\r\n- unit tests for signal blocking and `signalfd` reading\r\n\r\nTested with Linux + Rust 1.2 on: x86, x86_64, arm(raspberry pi)\r\n\r\nIf and when this gets merged, I will add support for signal handling via signalfd + epoll to `mio`."},"comment":{"url":"https://api.github.com/repos/carllerche/nix-rust/issues/comments/137859363","html_url":"https://github.com/carllerche/nix-rust/pull/186#issuecomment-137859363","issue_url":"https://api.github.com/repos/carllerche/nix-rust/issues/186","id":137859363,"user":{"login":"geofft","id":74644,"avatar_url":"https://avatars.githubusercontent.com/u/74644?v=3","gravatar_id":"","url":"https://api.github.com/users/geofft","html_url":"https://github.com/geofft","followers_url":"https://api.github.com/users/geofft/followers","following_url":"https://api.github.com/users/geofft/following{/other_user}","gists_url":"https://api.github.com/users/geofft/gists{/gist_id}","starred_url":"https://api.github.com/users/geofft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geofft/subscriptions","organizations_url":"https://api.github.com/users/geofft/orgs","repos_url":"https://api.github.com/users/geofft/repos","events_url":"https://api.github.com/users/geofft/events{/privacy}","received_events_url":"https://api.github.com/users/geofft/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T21:42:19Z","updated_at":"2015-09-04T21:42:19Z","body":"Ah! Yeah, if you're not doing realtime signals with data (which _do_ work properly, but it's a very niche use case) and you're just doing hand-delivered signals for configuration, then you don't care about coalescing, but you also don't care about data. In that case, I'd vaguely suggest not exposing new things in `siginfo` or any of the data fields in `signalfd_siginfo` besides `ssi_siginfo`, so that there aren't any implicit promises about their validity/usefulness, and leaving a comment about it. (I'm also curious who the existing user of the members of `siginfo` is, but I have half a suspicion that it's libstd and this was copied from libstd....)\r\n\r\nI am pretty sure it's true that you can just make signals an event on all platforms instead of adding a method to `Handler`, and that does seem like a cleaner design."}}