im currently finishing 6.s081 by myself. and there are some codes i truely dont understand
// Allocate process.
if((np = allocproc()) == 0){
return -1;
}
// Copy user memory from parent to child.
if(uvmcopy(p->pagetable, np->pagetable, p->sz) < 0){
freeproc(np);
release(&np->lock);
return -1;
}
np->sz = p->sz;
// copy saved user registers.
*(np->trapframe) = *(p->trapframe);
these codes are about to create a new process and alocate it memory from its parent.
My question is when i ask chatgpt and google this line is not deep copy, thats a shallow copy is that right to do that? or thats a deep copy, chatgpt is wrong?
*(np->trapframe) = *(p->trapframe);