diff options
author | dzwdz | 2022-08-19 18:03:59 +0200 |
---|---|---|
committer | dzwdz | 2022-08-19 18:03:59 +0200 |
commit | 7a4bc281958c639cd52ff4f192933aa161ba81a4 (patch) | |
tree | 6afc254b32bc724d872227f4fb3699ef03f511a0 /src/kernel/proc.c | |
parent | e9161cdcda9e5170f3ea5f18a8275395004ffce4 (diff) |
kernel: kzalloc
Diffstat (limited to 'src/kernel/proc.c')
-rw-r--r-- | src/kernel/proc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/kernel/proc.c b/src/kernel/proc.c index a9ad37a..77c861c 100644 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -21,8 +21,7 @@ static _Noreturn void process_switch(struct process *proc); struct process *process_seed(void *data, size_t datalen) { assert(!process_first); - process_first = kmalloc(sizeof *process_first); - memset(process_first, 0, sizeof *process_first); + process_first = kzalloc(sizeof *process_first); process_first->state = PS_RUNNING; process_first->pages = pagedir_new(); process_first->mount = vfs_mount_seed(); @@ -48,8 +47,7 @@ struct process *process_seed(void *data, size_t datalen) { } struct process *process_fork(struct process *parent, int flags) { - struct process *child = kmalloc(sizeof *child); - memset(child, 0, sizeof *child); + struct process *child = kzalloc(sizeof *child); if (flags & FORK_SHAREMEM) { if (!parent->pages_refcount) { |