mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:32:45 +00:00 
			
		
		
		
	Kernel: Make realpath() take path+length, get rid of SmapDisabler
This commit is contained in:
		
							parent
							
								
									d6b06fd5a3
								
							
						
					
					
						commit
						7c916b9fe9
					
				
					 4 changed files with 29 additions and 13 deletions
				
			
		|  | @ -704,10 +704,15 @@ uint32_t arc4random_uniform(uint32_t max_bounds) | |||
| 
 | ||||
| char* realpath(const char* pathname, char* buffer) | ||||
| { | ||||
|     if (!pathname) { | ||||
|         errno = EFAULT; | ||||
|         return nullptr; | ||||
|     } | ||||
|     size_t size = PATH_MAX; | ||||
|     if (buffer == nullptr) | ||||
|         buffer = (char*)malloc(size); | ||||
|     int rc = syscall(SC_realpath, pathname, buffer, size); | ||||
|     Syscall::SC_realpath_params params { pathname, strlen(pathname), buffer, size }; | ||||
|     int rc = syscall(SC_realpath, ¶ms); | ||||
|     if (rc < 0) { | ||||
|         errno = -rc; | ||||
|         return nullptr; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling