add PCTL_DELETE for removing pipes
This commit is contained in:
@ -61,6 +61,21 @@ int32_t SYSCALL5(sys_ipcpipe, pid1, pipenum1, cmd1, buffer1, len1) {
|
||||
|
||||
ret = E_OK;
|
||||
} break;
|
||||
case IPCPIPE_DELETE: {
|
||||
if (pipenum >= PROC_PIPEHANDLES_MAX) {
|
||||
ret = E_NOMEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
spinlock_acquire(&proc->pipes_spinlock);
|
||||
if (proc->pipes[pipenum] != NULL) {
|
||||
ipc_pipefree(proc->pipes[pipenum]);
|
||||
dlfree(proc->pipes[pipenum]);
|
||||
proc->pipes[pipenum] = NULL;
|
||||
}
|
||||
spinlock_release(&proc->pipes_spinlock);
|
||||
ret = E_OK;
|
||||
} break;
|
||||
case IPCPIPE_WRITE: {
|
||||
if (pipenum >= PROC_PIPEHANDLES_MAX) {
|
||||
ret = E_INVALIDARGUMENT;
|
||||
|
Reference in New Issue
Block a user