Skip to content

Commit 75a69bf

Browse files
committed
On non-musl Linux, strerror_r should be linked to __xpg_strerror_r
Signed-off-by: NODA, Kai <[email protected]>
1 parent f288e18 commit 75a69bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/unix/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@ extern {
506506
pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t,
507507
oldset: *mut sigset_t) -> ::c_int;
508508
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
509-
510-
// #[cfg_attr(target_os = "linux", link_name = "__xpg_strerror_r")]
509+
#[cfg_attr(all(target_os = "linux", not(target_env = "musl")),
510+
link_name = "__xpg_strerror_r")]
511511
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char,
512512
buflen: ::size_t) -> ::c_int;
513513

0 commit comments

Comments
 (0)