@@ -757,11 +757,11 @@ pub enum SigHandler {
757757 /// Request that the signal be ignored.
758758 SigIgn ,
759759 /// Use the given signal-catching function, which takes in the signal.
760- Handler ( extern fn ( libc:: c_int) ) ,
760+ Handler ( extern "C" fn ( libc:: c_int) ) ,
761761 /// Use the given signal-catching function, which takes in the signal, information about how
762762 /// the signal was generated, and a pointer to the threads `ucontext_t`.
763763 #[ cfg( not( target_os = "redox" ) ) ]
764- SigAction ( extern fn ( libc:: c_int, * mut libc:: siginfo_t, * mut libc:: c_void) )
764+ SigAction ( extern "C" fn ( libc:: c_int, * mut libc:: siginfo_t, * mut libc:: c_void) )
765765}
766766
767767/// Action to take on receipt of a signal. Corresponds to `sigaction`.
@@ -790,9 +790,9 @@ impl SigAction {
790790 ( * p) . sa_sigaction = match handler {
791791 SigHandler :: SigDfl => libc:: SIG_DFL ,
792792 SigHandler :: SigIgn => libc:: SIG_IGN ,
793- SigHandler :: Handler ( f) => f as * const extern fn ( libc:: c_int) as usize ,
793+ SigHandler :: Handler ( f) => f as * const extern "C" fn ( libc:: c_int) as usize ,
794794 #[ cfg( not( target_os = "redox" ) ) ]
795- SigHandler :: SigAction ( f) => f as * const extern fn ( libc:: c_int, * mut libc:: siginfo_t, * mut libc:: c_void) as usize ,
795+ SigHandler :: SigAction ( f) => f as * const extern "C" fn ( libc:: c_int, * mut libc:: siginfo_t, * mut libc:: c_void) as usize ,
796796 } ;
797797 }
798798 }
@@ -852,9 +852,9 @@ impl SigAction {
852852 // ensured that it is correctly initialized.
853853 unsafe {
854854 * ( & p as * const usize
855- as * const extern fn ( _, _, _) )
855+ as * const extern "C" fn ( _, _, _) )
856856 }
857- as extern fn ( _, _, _) ) ,
857+ as extern "C" fn ( _, _, _) ) ,
858858 p => SigHandler :: Handler (
859859 // Safe for one of two reasons:
860860 // * The SigHandler was created by SigHandler::new, in which
@@ -864,9 +864,9 @@ impl SigAction {
864864 // ensured that it is correctly initialized.
865865 unsafe {
866866 * ( & p as * const usize
867- as * const extern fn ( libc:: c_int) )
867+ as * const extern "C" fn ( libc:: c_int) )
868868 }
869- as extern fn ( libc:: c_int) ) ,
869+ as extern "C" fn ( libc:: c_int) ) ,
870870 }
871871 }
872872
@@ -880,12 +880,12 @@ impl SigAction {
880880 p if self . flags( ) . contains( SaFlags :: SA_SIGINFO ) =>
881881 SigHandler :: SigAction (
882882 * ( & p as * const usize
883- as * const extern fn ( _, _, _) )
884- as extern fn ( _, _, _) ) ,
883+ as * const extern "C" fn ( _, _, _) )
884+ as extern "C" fn ( _, _, _) ) ,
885885 p => SigHandler :: Handler (
886886 * ( & p as * const usize
887- as * const extern fn ( libc:: c_int) )
888- as extern fn ( libc:: c_int) ) ,
887+ as * const extern "C" fn ( libc:: c_int) )
888+ as extern "C" fn ( libc:: c_int) ) ,
889889 }
890890 }
891891 }
@@ -947,7 +947,7 @@ pub unsafe fn sigaction(signal: Signal, sigaction: &SigAction) -> Result<SigActi
947947/// # use nix::sys::signal::{self, Signal, SigHandler};
948948/// static SIGNALED: AtomicBool = AtomicBool::new(false);
949949///
950- /// extern fn handle_sigint(signal: libc::c_int) {
950+ /// extern "C" fn handle_sigint(signal: libc::c_int) {
951951/// let signal = Signal::try_from(signal).unwrap();
952952/// SIGNALED.store(signal == Signal::SIGINT, Ordering::Relaxed);
953953/// }
@@ -984,7 +984,7 @@ pub unsafe fn signal(signal: Signal, handler: SigHandler) -> Result<SigHandler>
984984 libc:: SIG_DFL => SigHandler :: SigDfl ,
985985 libc:: SIG_IGN => SigHandler :: SigIgn ,
986986 p => SigHandler :: Handler (
987- unsafe { * ( & p as * const usize as * const extern fn ( libc:: c_int) ) } as extern fn ( libc:: c_int) ) ,
987+ unsafe { * ( & p as * const usize as * const extern "C" fn ( libc:: c_int) ) } as extern "C" fn ( libc:: c_int) ) ,
988988 }
989989 } )
990990}
0 commit comments