Cast refernces of libc::RLIMIT_NOFILE to i32 for newer libc crate.
BUG=chromium:1021609
TEST=emerge-sand crosvm
Change-Id: I9658d3816cc846be2b6320f2f03036375de67cbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1979532
Tested-by: Allen Webb <allenwebb@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Commit-Queue: Allen Webb <allenwebb@google.com>
diff --git a/src/linux.rs b/src/linux.rs
index 62bfd68..dbfad21 100644
--- a/src/linux.rs
+++ b/src/linux.rs
@@ -320,7 +320,7 @@
// Run in an empty network namespace.
j.namespace_net();
// Most devices don't need to open many fds.
- j.set_rlimit(libc::RLIMIT_NOFILE, 1024, 1024)
+ j.set_rlimit(libc::RLIMIT_NOFILE as i32, 1024, 1024)
.map_err(Error::SettingMaxOpenFiles)?;
// Apply the block device seccomp policy.
j.no_new_privs();
@@ -796,7 +796,7 @@
// The file server opens a lot of fds and needs a really high open file limit.
let max_open_files = get_max_open_files()?;
- j.set_rlimit(libc::RLIMIT_NOFILE, max_open_files, max_open_files)
+ j.set_rlimit(libc::RLIMIT_NOFILE as i32, max_open_files, max_open_files)
.map_err(Error::SettingMaxOpenFiles)?;
// TODO(chirantan): Use more than one worker once the kernel driver has been fixed to not panic