MCPcopy Create free account
hub / github.com/Bananymous/banan-os / create_process

Method create_process

kernel/kernel/Process.cpp:78–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77 static void with_process(pid_t pid, const BAN::Function<void(Process&)>& callback)
78 {
79 SpinLockGuard _(s_process_lock);
80
81 for (auto* process : s_processes)
82 {
83 if (process->pid() != pid)
84 continue;
85 callback(*process);
86 break;
87 }
88 }
89
90 Process* Process::create_process(const Credentials& credentials, pid_t parent, pid_t sid, pid_t pgrp)
91 {
92 static BAN::Atomic<pid_t> s_next_id = 1;
93
94 pid_t pid = s_next_id++;
95 if (sid == 0 && pgrp == 0)
96 {
97 sid = pid;
98 pgrp = pid;
99 }
100
101 ASSERT(sid > 0);

Callers

nothing calls this directly

Calls 1

on_process_createMethod · 0.80

Tested by

no test coverage detected