File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -828,13 +828,30 @@ impl Child {
828828/// this function at a known point where there are no more destructors left
829829/// to run.
830830///
831+ /// ## Platform-specific behavior
832+ ///
833+ /// **Unix**: On Unix-like platforms, it is unlikely that all 32 bits of `exit`
834+ /// will be visible to a parent process inspecting the exit code. On most
835+ /// Unix-like platforms, only the eight least-significant bits are considered.
836+ ///
831837/// # Examples
832838///
833839/// ```
834840/// use std::process;
835841///
836842/// process::exit(0);
837843/// ```
844+ ///
845+ /// Due to [platform-specific behavior], the exit code for this example will be
846+ /// `0` on Linux, but `256` on Windows:
847+ ///
848+ /// ```no_run
849+ /// use std::process;
850+ ///
851+ /// process::exit(0x0f00);
852+ /// ```
853+ ///
854+ /// [platform-specific behavior]: #platform-specific-behavior
838855#[ stable( feature = "rust1" , since = "1.0.0" ) ]
839856pub fn exit ( code : i32 ) -> ! {
840857 :: sys_common:: cleanup ( ) ;
You can’t perform that action at this time.
0 commit comments