Skip to content

Commit f34c2bc

Browse files
committed
SFix compilation on musl: Vendor RWF_NOWAIT constant
Signed-off-by: Jiahao XU <[email protected]>
1 parent c65cd8e commit f34c2bc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/unix.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ mod linux {
403403

404404
use libc::{iovec, off_t, ssize_t, syscall, SYS_preadv2};
405405

406+
const RWF_NOWAIT: c_int = 0x00000008;
407+
406408
fn cvt_ssize(t: ssize_t) -> io::Result<ssize_t> {
407409
if t == -1 {
408410
Err(io::Error::last_os_error())
@@ -454,7 +456,7 @@ mod linux {
454456
},
455457
1,
456458
-1,
457-
libc::RWF_NOWAIT,
459+
RWF_NOWAIT,
458460
)
459461
}) {
460462
Ok(cnt) => Ok(cnt.try_into().unwrap()),

0 commit comments

Comments
 (0)