Tracking Issue for unix_sigpipe
#97889
Labels
C-tracking-issue
Category: A tracking issue for an RFC or an unstable feature.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Enselic commentedJun 8, 2022
•
edited
The feature gate for the issue is
#![feature(unix_sigpipe)]
.A new
fn main()
attribute#[unix_sigpipe = "inherit|sig_ign|sig_dfl"]
is added. The namessig_ign
andsig_dfl
comes from the signal handler namesSIG_IGN
andSIG_DFL
.Naming convention
The naming follows the convention used by
#![windows_subsystem = "windows|console"]
where the values"windows"
and"console"
have the same names as the actual linker flags:/SUBSYSTEM:WINDOWS
and/SUBSYSTEM:CONSOLE
.Usage
Please refer to the unstable book section for more details. In short:
#[unix_sigpipe = "..."]
inherit
SIGPIPE
untounched before enteringfn main()
. Normally this means theSIGPIPE
handler isSIG_DFL
.sig_dfl
SIGPIPE
handler toSIG_DFL
before invokingfn main()
.sig_ign
SIGPIPE
handler toSIG_IGN
before invokingfn main()
. Default behaviour since 2014.SIGPIPE
The problem with the current
SIGPIPE
code in libstd as well as several other aspects of this problem is discussed extensively at these places:Steps
Unresolved Questions
sig_dfl
or isinherit
andsig_ign
sufficient?SIGPIPE
, if we want to do it at all?lto
to remove the _signal stub code completely? With a bool it works, with u8 we might need to do some tweaks.fn lang_start()
. And a stable Rust ABI is not even close (see rust-lang/rfcs#600).Resolved Questions
-Z unix_sigpipe
flag instead, see https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Proposal.3A.20First.20step.20towards.20solving.20the.20SIGPIPE.20problem/near/285499895, at least not initially.sigpipe: u8
argument tofn lang_start()
on Unix platform viacfg
? A: No, this is not allowed, see https://github.com/rust-lang/rust/blob/master/src/tools/tidy/src/pal.rsAbout tracking issues
Tracking issues are used to record the overall progress of implementation. They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
@rustbot label +T-libs
The text was updated successfully, but these errors were encountered: