shadow_rs/host/syscall/handler/
resource.rs1use linux_api::errno::Errno;
2use shadow_shim_helper_rs::syscall_types::ForeignPtr;
3
4use crate::host::syscall::handler::{SyscallContext, SyscallHandler};
5use crate::host::syscall::types::SyscallError;
6
7impl SyscallHandler {
8 log_syscall!(
9 prlimit64,
10 std::ffi::c_int,
11 linux_api::posix_types::kernel_pid_t,
12 std::ffi::c_uint,
13 *const std::ffi::c_void,
14 *const std::ffi::c_void,
15 );
16 pub fn prlimit64(
17 _ctx: &mut SyscallContext,
18 pid: linux_api::posix_types::kernel_pid_t,
19 resource: std::ffi::c_uint,
20 _new_rlim: ForeignPtr<()>,
21 _old_rlim: ForeignPtr<()>,
22 ) -> Result<(), SyscallError> {
23 log::trace!("prlimit64 called on pid {pid} for resource {resource}");
24
25 if pid == 0 {
29 Err(SyscallError::Native)
31 } else {
32 Err(Errno::EOPNOTSUPP.into())
36 }
37 }
38}