mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 01:12:44 +00:00 
			
		
		
		
	 7de831efc6
			
		
	
	
		7de831efc6
		
	
	
	
	
		
			
			This syscall allows a parent process to disown a child process, setting its parent PID to 0. Unparented processes are automatically reaped by the kernel upon exit, and no sys$waitid() is required. This will make it much nicer to do spawn-and-forget which is common in the GUI environment.
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			509 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			509 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ## Name
 | |
| 
 | |
| disown - disown a child process
 | |
| 
 | |
| ## Synopsis
 | |
| 
 | |
| ```**c++
 | |
| #include <serenity.h>
 | |
| 
 | |
| int disown(pid_t pid);
 | |
| ```
 | |
| 
 | |
| ## Description
 | |
| 
 | |
| `disown()` unparents a child process of the calling process. The child's parent PID is set to zero, which allows the kernel to automatically reap it upon death.
 | |
| 
 | |
| ## Pledge
 | |
| 
 | |
| In pledged programs, the `proc` promise is required for this system call.
 | |
| 
 | |
| ## Errors
 | |
| 
 | |
| * `ESRCH`: No process with PID `pid` was found.
 | |
| * `ECHILD`: The target process is not a child of the calling process.
 | |
| 
 |