mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 11:12:45 +00:00 
			
		
		
		
	UserspaceEmulator: Add support for watch_file
This commit is contained in:
		
							parent
							
								
									178190ab52
								
							
						
					
					
						commit
						09b095e62a
					
				
					 2 changed files with 9 additions and 0 deletions
				
			
		|  | @ -400,6 +400,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3) | ||||||
|         return virt$set_thread_name(arg1, arg2, arg3); |         return virt$set_thread_name(arg1, arg2, arg3); | ||||||
|     case SC_setsid: |     case SC_setsid: | ||||||
|         return virt$setsid(); |         return virt$setsid(); | ||||||
|  |     case SC_watch_file: | ||||||
|  |         return virt$watch_file(arg1, arg2); | ||||||
|     default: |     default: | ||||||
|         reportln("\n=={}==  \033[31;1mUnimplemented syscall: {}\033[0m, {:p}", getpid(), Syscall::to_string((Syscall::Function)function), function); |         reportln("\n=={}==  \033[31;1mUnimplemented syscall: {}\033[0m, {:p}", getpid(), Syscall::to_string((Syscall::Function)function), function); | ||||||
|         dump_backtrace(); |         dump_backtrace(); | ||||||
|  | @ -1493,4 +1495,10 @@ pid_t Emulator::virt$setsid() | ||||||
|     return syscall(SC_setsid); |     return syscall(SC_setsid); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | int Emulator::virt$watch_file(FlatPtr user_path_addr, size_t path_length) | ||||||
|  | { | ||||||
|  |     auto user_path = mmu().copy_buffer_from_vm(user_path_addr, path_length); | ||||||
|  |     return syscall(SC_watch_file, user_path.data(), user_path.size()); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -155,6 +155,7 @@ private: | ||||||
|     int virt$sched_getparam(pid_t, FlatPtr); |     int virt$sched_getparam(pid_t, FlatPtr); | ||||||
|     int virt$set_thread_name(pid_t, FlatPtr, size_t); |     int virt$set_thread_name(pid_t, FlatPtr, size_t); | ||||||
|     pid_t virt$setsid(); |     pid_t virt$setsid(); | ||||||
|  |     int virt$watch_file(FlatPtr, size_t); | ||||||
| 
 | 
 | ||||||
|     FlatPtr allocate_vm(size_t size, size_t alignment); |     FlatPtr allocate_vm(size_t size, size_t alignment); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Simon Danner
						Simon Danner