Fix socketpair and epoll_create1's throw_unsup_format wording
This commit is contained in:
parent
c5e94246a3
commit
fe7d97787e
2 changed files with 10 additions and 7 deletions
|
@ -57,10 +57,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
||||||
let flags = this.read_scalar(flags)?.to_i32()?;
|
let flags = this.read_scalar(flags)?.to_i32()?;
|
||||||
|
|
||||||
let epoll_cloexec = this.eval_libc_i32("EPOLL_CLOEXEC");
|
let epoll_cloexec = this.eval_libc_i32("EPOLL_CLOEXEC");
|
||||||
if flags == epoll_cloexec {
|
|
||||||
// Miri does not support exec, so this flag has no effect.
|
// Miri does not support exec, so EPOLL_CLOEXEC flag has no effect.
|
||||||
} else if flags != 0 {
|
if flags != epoll_cloexec && flags != 0 {
|
||||||
throw_unsup_format!("epoll_create1 flags {flags} are not implemented");
|
throw_unsup_format!(
|
||||||
|
"epoll_create1: flag {:#x} is unsupported, only 0 or EPOLL_CLOEXEC are allowed",
|
||||||
|
flags
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let fd = this.machine.fds.insert_fd(FileDescriptor::new(Epoll::default()));
|
let fd = this.machine.fds.insert_fd(FileDescriptor::new(Epoll::default()));
|
||||||
|
|
|
@ -179,19 +179,19 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
||||||
// their values differ.
|
// their values differ.
|
||||||
if domain != this.eval_libc_i32("AF_UNIX") && domain != this.eval_libc_i32("AF_LOCAL") {
|
if domain != this.eval_libc_i32("AF_UNIX") && domain != this.eval_libc_i32("AF_LOCAL") {
|
||||||
throw_unsup_format!(
|
throw_unsup_format!(
|
||||||
"socketpair: Unsupported domain {:#x} is used, only AF_UNIX \
|
"socketpair: domain {:#x} is unsupported, only AF_UNIX \
|
||||||
and AF_LOCAL are allowed",
|
and AF_LOCAL are allowed",
|
||||||
domain
|
domain
|
||||||
);
|
);
|
||||||
} else if type_ != 0 {
|
} else if type_ != 0 {
|
||||||
throw_unsup_format!(
|
throw_unsup_format!(
|
||||||
"socketpair: Unsupported type {:#x} is used, only SOCK_STREAM, \
|
"socketpair: type {:#x} is unsupported, only SOCK_STREAM, \
|
||||||
SOCK_CLOEXEC and SOCK_NONBLOCK are allowed",
|
SOCK_CLOEXEC and SOCK_NONBLOCK are allowed",
|
||||||
type_
|
type_
|
||||||
);
|
);
|
||||||
} else if protocol != 0 {
|
} else if protocol != 0 {
|
||||||
throw_unsup_format!(
|
throw_unsup_format!(
|
||||||
"socketpair: Unsupported socket protocol {protocol} is used, \
|
"socketpair: socket protocol {protocol} is unsupported, \
|
||||||
only 0 is allowed",
|
only 0 is allowed",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue