niri
Clone
https://git.tahinli.com/Tahinli/niri.git
0 watching0 forksRustGPL-3.012.1 MiB9d8f4f8Ivan Molodetskikh1 month ago2997 commits
| 1 | //! We set a signal handler with `calloop::signals::Signals::new`. |
| 2 | //! This does two things: |
| 3 | //! 1. It blocks the thread from receiving these signals normally (pthread_sigmask) |
| 4 | //! 2. It creates a signalfd to read them in the event loop. |
| 5 | //! |
| 6 | //! When spawning children, calloop already deals with the signalfd. |
| 7 | //! `Signals::new` creates it with CLOEXEC, so it will not be inherited by children. |
| 8 | //! |
| 9 | //! But, the sigmask is always inherited, so we want to clear it before spawning children. |
| 10 | //! That way, we don't affect their normal signal handling. |
| 11 | //! |
| 12 | //! In particular, if a child doesn't care about signals, we must not block it from receiving them. |
| 13 | //! |
| 14 | //! This module provides functions to clear the sigmask. Call them before spawning children. |
| 15 | //! |
| 16 | //! Technically, a "more correct" solution would be to remember the original sigmask and restore it |
| 17 | //! after the child exits, but that's painful *and* likely to cause issues, because the user almost |
| 18 | //! never intended to spawn niri with a nonempty sigmask. It indicates a bug in whoever spawned us, |
| 19 | //! so we may as well clean up after them (which is easier than not doing so). |
| 20 | |
| 21 | pub use *; |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 |