-
Notifications
You must be signed in to change notification settings - Fork 394
Open
Labels
A-shimsArea: This affects the external function shimsArea: This affects the external function shimsA-unixArea: affects our shared Unix target supportArea: affects our shared Unix target supportC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementE-good-second-issueA good issue to pick up if you've already seen some parts of Miri, mentoring is availableA good issue to pick up if you've already seen some parts of Miri, mentoring is available
Description
readv and writev are vectored versions of read/write which are included in POSIX. (See e.g. man 3p readv, writev .) They could be (and sometimes have been) implemented using a loop and many read or write calls, so their semantics are not unusual.
I was advised to make this issue by the following error message:
test test ... error: unsupported operation: can't call foreign function `readv` on OS `linux`
--> src/test.rs:125:19
|
125 | let ret = libc::readv(src_fd.as_raw_fd(), iovs.as_ptr(), iovs.len() as _);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `readv` on OS `linux`
|
= help: if this is a basic API commonly used on this target, please report an issue with Miri
= help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases
A workaround for this error: under cfg(miri), replace libc::readv/libc::writev with functions that implement them using libc::read/libc::write directly.
RalfJung
Metadata
Metadata
Assignees
Labels
A-shimsArea: This affects the external function shimsArea: This affects the external function shimsA-unixArea: affects our shared Unix target supportArea: affects our shared Unix target supportC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementE-good-second-issueA good issue to pick up if you've already seen some parts of Miri, mentoring is availableA good issue to pick up if you've already seen some parts of Miri, mentoring is available