diff --git a/src/header/float/cbindgen.toml b/src/header/float/cbindgen.toml index dc4839c9ae..13118e74d7 100644 --- a/src/header/float/cbindgen.toml +++ b/src/header/float/cbindgen.toml @@ -41,6 +41,9 @@ after_includes = """ #define LDBL_HAS_SUBNORM 1 #define LDBL_DECIMAL_DIG DECIMAL_DIG +#define FLT_EVAL_METHOD 0 +#define DECIMAL_DIG 21 + // TODO: Support more architectures than x86_64 here: #define LDBL_TRUE_MIN 3.6451995318824746025e-4951L #define LDBL_MIN 3.3621031431120935063e-4932L @@ -50,6 +53,9 @@ after_includes = """ #define LDBL_MANT_DIG 64 #define LDBL_MIN_EXP (-16381) #define LDBL_MAX_EXP 16384 +#define LDBL_DIG 18 +#define LDBL_MIN_10_EXP (-4931) +#define LDBL_MAX_10_EXP 4932 #endif // _RELIBC_BITS_FLOAT_H """ diff --git a/src/header/stdlib/mod.rs b/src/header/stdlib/mod.rs index 687c4d357b..36b4958c77 100644 --- a/src/header/stdlib/mod.rs +++ b/src/header/stdlib/mod.rs @@ -57,6 +57,12 @@ pub const MB_CUR_MAX: c_int = 4; //Maximum number of bytes in a multibyte characters for any locale pub const MB_LEN_MAX: c_int = 4; +/// See . +#[unsafe(no_mangle)] +pub extern "C" fn getprogname() -> *const c_char { + unsafe { platform::program_invocation_short_name } +} + static ATEXIT_FUNCS: RawCell<[Option; 32]> = RawCell::new([None; 32]); static AT_QUICK_EXIT_FUNCS: RawCell<[Option; 32]> = RawCell::new([None; 32]); static L64A_BUFFER: RawCell<[c_char; 7]> = RawCell::new([0; 7]); // up to 6 digits plus null terminator diff --git a/src/pthread/mod.rs b/src/pthread/mod.rs index 48cecfee05..0a5f5082f6 100644 --- a/src/pthread/mod.rs +++ b/src/pthread/mod.rs @@ -121,12 +121,11 @@ pub(crate) unsafe fn create( ) -> Result { let attrs = attrs.cloned().unwrap_or_default(); - let mut current_sigmask = 0_u64; #[cfg(target_os = "redox")] - { - current_sigmask = - redox_rt::signal::get_sigmask().expect("failed to obtain sigprocmask for caller"); - } + let current_sigmask = + redox_rt::signal::get_sigmask().expect("failed to obtain sigprocmask for caller"); + #[cfg(not(target_os = "redox"))] + let current_sigmask = 0_u64; // Create a locked mutex, unlocked by the thread after it has started. let synchronization_mutex = unsafe { Mutex::locked(current_sigmask) };