/DragonOS/kernel/src/process/ |
H A D | exit.rs | 18 abi::WaitOption, pid::PidType, resource::RUsage, Pid, ProcessControlBlock, ProcessManager, 26 pub pid: Pid, field 37 pub pid: Pid, field 43 pub fn new(pid_type: PidType, pid: Pid, options: WaitOption) -> Self { in new() 46 pid, in new() 57 mut pid: i64, in kernel_wait4() 63 if pid == i64::MIN { in kernel_wait4() 70 if pid == -1 { in kernel_wait4() 72 } else if pid < 0 { in kernel_wait4() 75 pid = -pid; in kernel_wait4() [all …]
|
H A D | fork.rs | 183 current_pcb.pid(), in fork() 184 pcb.pid(), in fork() 192 procfs_register_pid(pcb.pid()).unwrap_or_else(|e| { in fork() 195 pcb.pid(), in fork() 205 pcb.pid(), in fork() 210 return Ok(pcb.pid()); in fork() 248 current_pcb.pid() in copy_mm() 259 current_pcb.pid(), new_pcb.pid(), e in copy_mm() 430 writer.copy_one_to_user(&(pcb.pid().0 as i32), 0)?; in copy_process() 436 current_pcb.pid(), pcb.pid(), e in copy_process() [all …]
|
H A D | timer.rs | 64 pub fn alarm_timer_init(pid: Pid, second: u64) -> AlarmTimer { in alarm_timer_init() 66 let timerfunc = AlarmTimerFunc::new(pid); in alarm_timer_init() 109 pid: Pid, field 113 pub fn new(pid: Pid) -> Box<AlarmTimerFunc> { in new() 114 return Box::new(AlarmTimerFunc { pid }); in new() 133 let mut info = SigInfo::new(sig, 0, SigCode::Timer, SigType::Alarm(self.pid)); in run() 138 .send_signal_info(Some(&mut info), self.pid) in run()
|
H A D | syscall.rs | 77 ProcessManager::fork(frame, CloneFlags::empty()).map(|pid| pid.into()) in fork() 143 pid: i64, in wait4() 166 let r = kernel_wait4(pid, wstatus_buf, options, tmp_rusage.as_mut())?; in wait4() 206 pub fn getpgid(mut pid: Pid) -> Result<Pid, SystemError> { in getpgid() 207 if pid == Pid(0) { in getpgid() 209 pid = current_pcb.pid(); in getpgid() 211 let target_proc = ProcessManager::find(pid).ok_or(SystemError::ESRCH)?; in getpgid() 245 procfs_register_pid(pcb.pid()).unwrap_or_else(|e| { in clone() 248 pcb.pid(), in clone() 261 writer.copy_one_to_user(&(pcb.pid().data() as i32), 0)?; in clone() [all …]
|
H A D | mod.rs | 78 pub mod pid; module 177 return ProcessManager::current_pcb().pid(); in current_pid() 205 pub fn find(pid: Pid) -> Option<Arc<ProcessControlBlock>> { in find() 206 return ALL_PROCESS.lock_irqsave().as_ref()?.get(&pid).cloned(); in find() 223 .insert(pcb.pid(), pcb.clone()); in add_pcb() 355 if current.pid() != Pid(1) { in exit_notify() 366 let r = Syscall::kill(parent_pcb.pid(), Signal::SIGCHLD as i32); in exit_notify() 370 current.pid(), in exit_notify() 371 parent_pcb.pid() in exit_notify() 388 let pid = pcb.pid(); in exit() localVariable [all …]
|
/DragonOS/user/apps/test_mkfifo/ |
H A D | main.c | 15 pid_t pid; in main() local 25 pid = fork(); in main() 27 if (pid < 0) in main() 32 else if (pid == 0) in main() 69 waitpid(pid, &status, 0); in main()
|
/DragonOS/docs/kernel/container/namespaces/ |
H A D | pid_namespace.md | 5 pid_namespace 是内核中的一种名称空间,用于实现进程隔离,允许在不同的名称空间中运行的进程有独立的pid试图 10 - pid_namespace 内有独立的一套进程分配器,以及孤儿进程回收器,独立管理内部的pid 11 - 不同进程的详细信息都存放在proc文件系统中,里面的找到对应的pid号里面的信息都在pid中,记录的是pid_namespace中的信息
|
/DragonOS/user/apps/test_shm/ |
H A D | sender.c | 32 int pid = fork(); in main() local 33 if (pid == 0) in main() 38 waitpid(pid, NULL, 0); in main()
|
/DragonOS/kernel/src/arch/x86_64/syscall/ |
H A D | mod.rs | 55 let pid = ProcessManager::current_pcb().pid(); localVariable 56 debug!("syscall return:pid={:?},ret= {:?}\n", pid, ret as isize); 89 let pid = ProcessManager::current_pcb().pid(); in syscall_handler() localVariable 98 debug!("syscall: pid: {:?}, num={:?}\n", pid, syscall_num); in syscall_handler()
|
/DragonOS/kernel/src/arch/riscv64/syscall/ |
H A D | mod.rs | 20 let pid = ProcessManager::current_pcb().pid(); localVariable 21 log::debug!("syscall return:pid={:?},ret= {:?}\n", pid, ret as isize);
|
/DragonOS/kernel/src/arch/x86_64/process/ |
H A D | kthread.rs | 45 let pid = ProcessManager::fork(&frame, clone_flags).inspect_err(|_e| { in __inner_create() localVariable 49 ProcessManager::find(pid) in __inner_create() 53 return Ok(pid); in __inner_create()
|
H A D | syscall.rs | 168 if pcb.pid() == ProcessManager::current_pcb().pid() { in do_arch_prctl_64() 174 if pcb.pid() == ProcessManager::current_pcb().pid() { in do_arch_prctl_64()
|
/DragonOS/kernel/src/ipc/ |
H A D | signal.rs | 11 process::{pid::PidType, Pid, ProcessControlBlock, ProcessFlags, ProcessManager}, 58 pid: Pid, in send_signal_info() 66 if pid.lt(&Pid::from(0)) { in send_signal_info() 67 warn!("Kill operation not support: pid={:?}", pid); in send_signal_info() 76 let pcb = ProcessManager::find(pid); in send_signal_info() 148 SigType::Kill(ProcessManager::current_pcb().pid()), in send_signal() 325 ProcessManager::current_pcb().pid(), in signal_wake_up() 326 pcb.pid(), in signal_wake_up() 335 ProcessManager::current_pcb().pid(), in signal_wake_up() 336 pcb.pid(), in signal_wake_up()
|
/DragonOS/kernel/src/filesystem/procfs/ |
H A D | mod.rs | 73 pid: Pid, field 147 let pid = self.fdata.pid; in open_status() localVariable 148 let pcb = ProcessManager::find(pid); in open_status() 154 pid in open_status() 185 &mut format!("\nPid:\t{}", pcb.pid().into()) in open_status() 348 pid: Pid::new(0), in new() 379 meminfo_file.0.lock().fdata.pid = Pid::new(0); in new() 392 kmsg_file.0.lock().fdata.pid = Pid::new(1); in new() 403 pub fn register_pid(&self, pid: Pid) -> Result<(), SystemError> { in register_pid() 408 &pid.to_string(), in register_pid() [all …]
|
/DragonOS/kernel/src/libs/ |
H A D | mutex.rs | 68 if !self.check_pid_in_wait_list(&inner, ProcessManager::current_pcb().pid()) { in lock() 135 fn check_pid_in_wait_list(&self, inner: &MutexInner, pid: Pid) -> bool { in check_pid_in_wait_list() 137 if p.pid() == pid { in check_pid_in_wait_list()
|
/DragonOS/user/apps/test_namespace/src/ |
H A D | main.rs | 16 Ok(WaitStatus::Exited(pid, status)) => { in main() 17 println!("Child {} exited with status: {}", pid, status); in main()
|
/DragonOS/kernel/src/arch/x86_64/mm/ |
H A D | fault.rs | 243 let pid = ProcessManager::current_pid(); in do_user_addr_fault() localVariable 245 SigInfo::new(Signal::SIGSEGV, 0, SigCode::User, SigType::Kill(pid)); in do_user_addr_fault() 247 .send_signal_info(Some(&mut info), pid) in do_user_addr_fault() 274 let pid = ProcessManager::current_pid(); in do_user_addr_fault() localVariable 276 SigInfo::new(Signal::SIGSEGV, 0, SigCode::User, SigType::Kill(pid)); in do_user_addr_fault() 278 .send_signal_info(Some(&mut info), pid) in do_user_addr_fault()
|
/DragonOS/kernel/src/namespaces/ |
H A D | pid_namespace.rs | 84 pub fn put_pid(pid: PidStrcut) { in put_pid() 85 let ns = pid.numbers[pid.level].ns.clone(); in put_pid() 86 let id = pid.numbers[pid.level].nr.data(); in put_pid() 186 fn get(&self, pid: Pid) -> Option<Arc<NsCommon>> { in get() 187 let pcb = ProcessManager::find(pid); in get()
|
H A D | user_namespace.rs | 51 pid: Arc<RwLock<Pid>>, field 76 fn get(&self, pid: Pid) -> Option<Arc<NsCommon>> { in get() 129 pid: Arc::new(RwLock::new(Pid::new(1))), in new()
|
/DragonOS/kernel/src/time/ |
H A D | syscall.rs | 177 let pid = ProcessManager::current_pid(); in alarm() localVariable 178 let new_alarm = Some(AlarmTimer::alarm_timer_init(pid, 0)); in alarm() 192 let pid = ProcessManager::current_pid(); in alarm() localVariable 193 let new_alarm = Some(AlarmTimer::alarm_timer_init(pid, second.as_secs())); in alarm()
|
/DragonOS/kernel/src/arch/x86_64/ipc/ |
H A D | signal.rs | 465 error!("Trying to handle a Sigerror on Process:{:?}", pcb.pid()); in do_signal() 495 ProcessManager::current_pcb().pid(), in do_signal() 507 let _r = Syscall::kill(ProcessManager::current_pcb().pid(), Signal::SIGSEGV as i32) in sys_rt_sigreturn() 516 let _r = Syscall::kill(ProcessManager::current_pcb().pid(), Signal::SIGSEGV as i32) in sys_rt_sigreturn() 584 ProcessManager::current_pcb().pid(), in setup_frame() 588 ProcessManager::current_pcb().pid(), in setup_frame() 599 ProcessManager::current_pcb().pid() in setup_frame() 627 let r = Syscall::kill(ProcessManager::current_pcb().pid(), Signal::SIGSEGV as i32); in setup_frame() 638 let r = Syscall::kill(ProcessManager::current_pcb().pid(), Signal::SIGSEGV as i32); in setup_frame() 652 let r = Syscall::kill(ProcessManager::current_pcb().pid(), Signal::SIGSEGV as i32); in setup_frame() [all …]
|
/DragonOS/kernel/src/perf/ |
H A D | util.rs | 41 pub pid: i32, field 51 pid: i32, in try_from() 72 pid, in try_from()
|
/DragonOS/tools/qemu/ |
H A D | ifup-nat | 57 --pid-file=/var/run/qemu-dhcp-$BRIDGE.pid \
|
/DragonOS/kernel/src/debug/klog/ |
H A D | mm.rs | 53 pub fn log(log_type: AllocatorLogType, source: LogSource, pid: Option<Pid>) { in log() 59 pid.map(|p| p.data()), in log()
|
/DragonOS/kernel/src/arch/riscv64/process/ |
H A D | kthread.rs | 43 let pid = ProcessManager::fork(&frame, clone_flags).map_err(|e| { in __inner_create() localVariable 48 ProcessManager::find(pid) in __inner_create() 52 return Ok(pid); in __inner_create()
|