Suppose we have a system call write
, which takes in a buffer as an argument. This buffer memory is a part of the user address space.
How does the write call succeed further?
Suppose that if I assume that the entire buffer is copied to the kernel space and the now the process is preempted and some other process is given the CPU and the new process now issues a different system call, which might overwrite the buffer of the previous write
call.
How such a case is handled? Or there is an entirely different mechanism where no copy of data is done from user space to kernel space?