+
+ fn mkdir(
+ &mut self,
+ path_op: OpTy<'tcx, Tag>,
+ mode_op: OpTy<'tcx, Tag>,
+ ) -> InterpResult<'tcx, i32> {
+ let this = self.eval_context_mut();
+
+ this.check_no_isolation("mkdir")?;
+
+ let mode = this.read_scalar(mode_op)?.to_u32()?;
+
+ let path = this.read_os_str_from_c_str(this.read_scalar(path_op)?.not_undef()?)?;
+
+ let mut builder = DirBuilder::new();
+ #[cfg(target_family = "unix")]
+ {
+ use std::os::unix::fs::DirBuilderExt;
+ builder.mode(mode);
+ }
+ let result = builder.create(path).map(|_| 0i32);
+
+ this.try_unwrap_io_result(result)
+ }
+
+ fn rmdir(
+ &mut self,
+ path_op: OpTy<'tcx, Tag>,
+ ) -> InterpResult<'tcx, i32> {
+ let this = self.eval_context_mut();
+
+ this.check_no_isolation("rmdir")?;
+
+ let path = this.read_os_str_from_c_str(this.read_scalar(path_op)?.not_undef()?)?;
+
+ let result = remove_dir(path).map(|_| 0i32);
+
+ this.try_unwrap_io_result(result)
+ }