Skip to content

Commit

Permalink
set error values to correspond to the ones from GNU pthreads
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBiryukov91 committed Feb 28, 2024
1 parent e7cbf51 commit 19e862f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/platform/synchronization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ pub struct z_mutex_t(usize);
impl_guarded_transmute!(z_mutex_t, ZMutexPtr);
impl_guarded_transmute!(ZMutexPtr, z_mutex_t);

const EBUSY: i8 = -1;
const EINVAL: i8 = -2;
const EAGAIN: i8 = -3;
const EPOISON: i8 = -10;
// try to use the same error codes as in GNU pthreads
const EBUSY: i8 = 16;
const EINVAL: i8 = 22;
const EAGAIN: i8 = 11;
const EPOISON: i8 = 22; // same as EINVAL

#[no_mangle]
#[allow(clippy::missing_safety_doc)]
Expand Down

0 comments on commit 19e862f

Please sign in to comment.