- /// the Unix APIs usually handle.
- fn write_os_str_to_c_string(&mut self, os_str: &OsStr, scalar: Scalar<Tag>, size: u64) -> InterpResult<'tcx> {
+ /// the Unix APIs usually handle. This function returns `Ok(false)` without trying to write if
+ /// `size` is not large enough to fit the contents of `os_string` plus a null terminator. It
+ /// returns `Ok(true)` if the writing process was successful. Otherwise it returns an
+ /// `InterpError`.
+ fn write_os_str_to_c_string(
+ &mut self,
+ os_str: &OsStr,
+ scalar: Scalar<Tag>,
+ size: u64
+ ) -> InterpResult<'tcx, bool> {