unix_sigpipe: Add docs for init()
sigpipe
param
This commit is contained in:
parent
236903f7e9
commit
3d1a4e4f27
2 changed files with 4 additions and 0 deletions
|
@ -72,6 +72,8 @@ macro_rules! rtunwrap {
|
||||||
// Runs before `main`.
|
// Runs before `main`.
|
||||||
// SAFETY: must be called only once during runtime initialization.
|
// SAFETY: must be called only once during runtime initialization.
|
||||||
// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
|
// 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`.
|
||||||
#[cfg_attr(test, allow(dead_code))]
|
#[cfg_attr(test, allow(dead_code))]
|
||||||
unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
|
unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -49,6 +49,8 @@ pub fn init(argc: isize, argv: *const *const u8, _sigpipe: u8) {}
|
||||||
#[cfg(not(target_os = "espidf"))]
|
#[cfg(not(target_os = "espidf"))]
|
||||||
// SAFETY: must be called only once during runtime initialization.
|
// SAFETY: must be called only once during runtime initialization.
|
||||||
// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
|
// 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) {
|
pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
|
||||||
// The standard streams might be closed on application startup. To prevent
|
// The standard streams might be closed on application startup. To prevent
|
||||||
// std::io::{stdin, stdout,stderr} objects from using other unrelated file
|
// std::io::{stdin, stdout,stderr} objects from using other unrelated file
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue