File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -828,13 +828,30 @@ impl Child {
828
828
/// this function at a known point where there are no more destructors left
829
829
/// to run.
830
830
///
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
+ ///
831
837
/// # Examples
832
838
///
833
839
/// ```
834
840
/// use std::process;
835
841
///
836
842
/// process::exit(0);
837
843
/// ```
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
+ /// ```
849
+ /// use std::process;
850
+ ///
851
+ /// process::exit(0x0f00);
852
+ /// ```
853
+ ///
854
+ /// [platform-specific behavior]: #platform-specific-behavior
838
855
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
839
856
pub fn exit ( code : i32 ) -> ! {
840
857
:: sys_common:: cleanup ( ) ;
You can’t perform that action at this time.
0 commit comments