mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:22:43 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			455 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			455 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ## Name
 | |
| 
 | |
| gettid - get current thread ID
 | |
| 
 | |
| ## Synopsis
 | |
| 
 | |
| ```**c++
 | |
| #include <unistd.h>
 | |
| 
 | |
| int gettid();
 | |
| ```
 | |
| 
 | |
| ## Description
 | |
| 
 | |
| Returns the TID (thread ID) of the calling thread. The first thread in a process has the same TID and PID. Subsequently spawned threads will have unique thread ID's, but all share the same PID.
 | |
| 
 | |
| ## Return value
 | |
| 
 | |
| The thread ID of the calling thread.
 | |
| 
 | |
| ## Error
 | |
| 
 | |
| None.
 | |
| 
 | |
| ## See also
 | |
| 
 | |
| * [`getpid`(2)](getpid.md)
 | |
| * [`getppid`(2)](getppid.md)
 | 
