@@ -6,7 +6,7 @@ use axtask::{current, yield_now, TaskExtMut, TaskExtRef};
66use macro_rules_attribute:: apply;
77use num_enum:: TryFromPrimitive ;
88use starry_core:: {
9- ctypes:: { WaitFlags , WaitStatus } ,
9+ ctypes:: { WaitFlags , WaitStatus , RLimit , RLIMIT_AS , RLIMIT_NOFILE , RLIMIT_STACK } ,
1010 task:: { exec, wait_pid} ,
1111} ;
1212
@@ -148,12 +148,7 @@ pub fn sys_wait4(pid: i32, exit_code_ptr: UserPtr<i32>, option: u32) -> LinuxRes
148148 let exit_code_ptr = exit_code_ptr. nullable ( UserPtr :: get) ?;
149149 info ! ( "wait4: pid: {}, exit_code_ptr: {:?}, option: {}" , pid, exit_code_ptr, option) ;
150150 loop {
151- <<<<<<< HEAD : src/syscall_imp/task/thread. rs
152- let answer = wait_pid ( pid , exit_code_ptr. unwrap_or_else ( ptr:: null_mut ) ) ;
153- info ! ( "wait4: answer: {:?}" , answer) ;
154- =======
155151 let answer = unsafe { wait_pid ( pid, exit_code_ptr. unwrap_or_else ( ptr:: null_mut) ) } ;
156- >>>>>>> main: api/src/imp/task/thread. rs
157152 match answer {
158153 Ok ( pid) => {
159154 return Ok ( pid as isize ) ;
@@ -292,28 +287,3 @@ pub fn sys_prlimit64(
292287pub fn sys_gettid ( ) -> LinuxResult < isize > {
293288 Ok ( current ( ) . id ( ) . as_u64 ( ) as isize )
294289}
295-
296- #[ apply( syscall_instrument) ]
297- pub fn sys_fork ( ) -> LinuxResult < isize > {
298- info ! ( "fork" ) ;
299- info ! ( "transfer to clone" ) ;
300- // let flags = 17;
301- // let user_stack = 0;
302- // let ptid = 0;
303- // let arg3 = 0;
304- // let arg4 = 0;
305- // sys_clone(flags, user_stack, ptid, arg3, arg4)
306- let stack = None ;
307-
308- let curr_task = current ( ) ;
309-
310- if let Ok ( new_task_id) = curr_task
311- . task_ext ( )
312- . clone_task ( 17 , stack, 0 , 0 , 0 )
313- {
314- info ! ( "fork: new_task_id: {}" , new_task_id) ;
315- Ok ( new_task_id as isize )
316- } else {
317- Err ( LinuxError :: ENOMEM )
318- }
319- }
0 commit comments