| <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Interface for the `signalfd` syscall."><meta name="keywords" content="rust, rustlang, rust-lang, signalfd"><title>nix::sys::signalfd - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../../normalize.css"><link rel="stylesheet" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../../ayu.css" disabled><link rel="stylesheet" href="../../../dark.css" disabled><link rel="stylesheet" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script defer src="../../../main.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../nix/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../../nix/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module signalfd</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#reexports">Re-exports</a></li><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Module <a href="../../index.html">nix</a>::<wbr><a href="../index.html">sys</a>::<wbr><a class="mod" href="#">signalfd</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../../src/nix/sys/signalfd.rs.html#1-175">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Interface for the <code>signalfd</code> syscall.</p> |
| <h2 id="signal-discarding"><a href="#signal-discarding">Signal discarding</a></h2> |
| <p>When a signal can’t be delivered to a process (or thread), it will become a pending signal. |
| Failure to deliver could happen if the signal is blocked by every thread in the process or if |
| the signal handler is still handling a previous signal.</p> |
| <p>If a signal is sent to a process (or thread) that already has a pending signal of the same |
| type, it will be discarded. This means that if signals of the same type are received faster than |
| they are processed, some of those signals will be dropped. Because of this limitation, |
| <code>signalfd</code> in itself cannot be used for reliable communication between processes or threads.</p> |
| <p>Once the signal is unblocked, or the signal handler is finished, and a signal is still pending |
| (ie. not consumed from a signalfd) it will be delivered to the signal handler.</p> |
| <p>Please note that signal discarding is not specific to <code>signalfd</code>, but also happens with regular |
| signal handlers.</p> |
| </div></details><h2 id="reexports" class="small-section-header"><a href="#reexports">Re-exports</a></h2><div class="item-table"><div class="item-row"><div class="item-left import-item" id="reexport.signal"><code>pub use crate::sys::<a class="mod" href="../signal/index.html" title="mod nix::sys::signal">signal</a>;</code></div></div><div class="item-row"><div class="item-left import-item" id="reexport.SigSet"><code>pub use crate::sys::signal::<a class="struct" href="../signal/struct.SigSet.html" title="struct nix::sys::signal::SigSet">SigSet</a>;</code></div></div></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.SfdFlags.html" title="nix::sys::signalfd::SfdFlags struct">SfdFlags</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.SignalFd.html" title="nix::sys::signalfd::SignalFd struct">SignalFd</a></div><div class="item-right docblock-short">A helper struct for creating, reading and closing a <code>signalfd</code> instance.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.siginfo.html" title="nix::sys::signalfd::siginfo struct">siginfo</a></div></div></div><h2 id="constants" class="small-section-header"><a href="#constants">Constants</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.SIGNALFD_NEW.html" title="nix::sys::signalfd::SIGNALFD_NEW constant">SIGNALFD_NEW</a></div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.SIGNALFD_SIGINFO_SIZE.html" title="nix::sys::signalfd::SIGNALFD_SIGINFO_SIZE constant">SIGNALFD_SIGINFO_SIZE</a><span class="stab deprecated" title="">Deprecated</span></div></div></div><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.signalfd.html" title="nix::sys::signalfd::signalfd fn">signalfd</a></div><div class="item-right docblock-short">Creates a new file descriptor for reading signals.</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="nix" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html> |