mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 06:02:44 +00:00 
			
		
		
		
	Kernel: Add the futimens syscall
We have a problem with the original utimensat syscall because when we do call LibC futimens function, internally we provide an empty path, and the Kernel get_syscall_path_argument method will detect this as an invalid path. This happens to spit an error for example in the touch utility, so if a user is running "touch non_existing_file", it will create that file, but the user will still see an error coming from LibC futimens function. This new syscall gets an open file description and it provides the same functionality as utimensat, on the specified open file description. The new syscall will be used later by LibC to properly implement LibC futimens function so the situation described with relation to the "touch" utility could be fixed.
This commit is contained in:
		
							parent
							
								
									71e665f0f9
								
							
						
					
					
						commit
						cbf78975f1
					
				
					 5 changed files with 49 additions and 2 deletions
				
			
		|  | @ -84,6 +84,7 @@ enum class NeedsBigProcessLock { | |||
|     S(fsync, NeedsBigProcessLock::No)                      \ | ||||
|     S(ftruncate, NeedsBigProcessLock::No)                  \ | ||||
|     S(futex, NeedsBigProcessLock::Yes)                     \ | ||||
|     S(futimens, NeedsBigProcessLock::No)                   \ | ||||
|     S(get_dir_entries, NeedsBigProcessLock::Yes)           \ | ||||
|     S(get_root_session_id, NeedsBigProcessLock::No)        \ | ||||
|     S(get_stack_bounds, NeedsBigProcessLock::No)           \ | ||||
|  | @ -457,6 +458,11 @@ struct SC_utimensat_params { | |||
|     int flag; | ||||
| }; | ||||
| 
 | ||||
| struct SC_futimens_params { | ||||
|     int fd; | ||||
|     struct timespec const* times; | ||||
| }; | ||||
| 
 | ||||
| struct SC_waitid_params { | ||||
|     int idtype; | ||||
|     int id; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Liav A
						Liav A