From 3d1a4e4f2792948d78b3fed030e93c9c156fe35a Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Wed, 31 Aug 2022 18:11:48 +0200 Subject: unix_sigpipe: Add docs for `init()` `sigpipe` param --- library/std/src/sys/unix/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'library/std/src/sys') diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index d701f950e86..2856dfcb370 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -49,6 +49,8 @@ pub fn init(argc: isize, argv: *const *const u8, _sigpipe: u8) {} #[cfg(not(target_os = "espidf"))] // SAFETY: must be called only once during runtime initialization. // NOTE: this is not guaranteed to run, for example when Rust code is called externally. +// The extra parameter `sigpipe` allows rustc to generate code that instructs std whether +// or not to ignore `SIGPIPE`. pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) { // The standard streams might be closed on application startup. To prevent // std::io::{stdin, stdout,stderr} objects from using other unrelated file -- cgit 1.4.1-3-g733a5