Skip to content

Commit 235907b

Browse files
authored
Use libc::strerror_r instead of our own definition (#85)
1 parent 9928bb1 commit 235907b

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/unix.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// except according to those terms.
1414

1515
use core::str;
16-
use libc::{self, c_char, c_int, size_t, strlen};
16+
use libc::{self, c_int, size_t, strerror_r, strlen};
1717

1818
use crate::Errno;
1919

@@ -86,10 +86,4 @@ extern "C" {
8686
#[cfg_attr(target_os = "aix", link_name = "_Errno")]
8787
#[cfg_attr(target_os = "nto", link_name = "__get_errno_ptr")]
8888
fn errno_location() -> *mut c_int;
89-
90-
#[cfg_attr(
91-
any(target_os = "linux", target_os = "hurd"),
92-
link_name = "__xpg_strerror_r"
93-
)]
94-
fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int;
9589
}

src/wasi.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// except according to those terms.
1414

1515
use core::str;
16-
use libc::{self, c_char, c_int, size_t, strlen};
16+
use libc::{self, c_int, size_t, strerror_r, strlen};
1717

1818
use crate::Errno;
1919

@@ -56,5 +56,4 @@ pub fn set_errno(Errno(new_errno): Errno) {
5656

5757
extern "C" {
5858
fn __errno_location() -> *mut c_int;
59-
fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int;
6059
}

0 commit comments

Comments
 (0)