@@ -18,12 +18,13 @@ use std::time::Duration;
1818use sysdefs:: constants:: err_const:: { get_errno, handle_errno, syscall_error, Errno , VERBOSE } ;
1919use sysdefs:: constants:: fs_const:: { STDERR_FILENO , STDIN_FILENO , STDOUT_FILENO } ;
2020use sysdefs:: constants:: lind_platform_const:: {
21- MAX_LINEAR_MEMORY_SIZE , RAWPOSIX_CAGEID , UNUSED_ARG , UNUSED_ID , UNUSED_NAME , WASMTIME_CAGEID ,
21+ MAX_CAGEID , MAX_LINEAR_MEMORY_SIZE , RAWPOSIX_CAGEID , UNUSED_ARG , UNUSED_ID , UNUSED_NAME ,
22+ WASMTIME_CAGEID ,
2223} ;
2324use sysdefs:: constants:: sys_const:: {
2425 DEFAULT_GID , DEFAULT_UID , EXIT_SUCCESS , ITIMER_REAL , RLIMIT_AS , RLIMIT_DATA , RLIMIT_NOFILE ,
25- RLIMIT_RSS , RLIMIT_STACK , SIGCHLD , SIGKILL , SIGSTOP , SIG_BLOCK , SIG_SETMASK , SIG_UNBLOCK ,
26- WNOHANG ,
26+ RLIMIT_NPROC , RLIMIT_RSS , RLIMIT_STACK , SIGCHLD , SIGKILL , SIGSTOP , SIG_BLOCK , SIG_SETMASK ,
27+ SIG_UNBLOCK , WNOHANG ,
2728} ;
2829use sysdefs:: data:: fs_struct:: { ITimerVal , Rlimit , SigactionStruct } ;
2930use sysdefs:: logging:: lind_debug_panic;
@@ -1209,6 +1210,10 @@ pub extern "C" fn prlimit64_syscall(
12091210 old_limit. rlim_cur = MAX_LINEAR_MEMORY_SIZE as u32 ;
12101211 old_limit. rlim_max = MAX_LINEAR_MEMORY_SIZE as u32 ;
12111212 }
1213+ RLIMIT_NPROC => {
1214+ old_limit. rlim_cur = MAX_CAGEID as u32 ;
1215+ old_limit. rlim_max = MAX_CAGEID as u32 ;
1216+ }
12121217 _ => {
12131218 lind_debug_panic ( & format ! ( "prlimit64: unsupported resource {}" , resource) ) ;
12141219 old_limit. rlim_cur = 0 ;
0 commit comments