mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 09:52:44 +00:00 
			
		
		
		
	 8ebec2938c
			
		
	
	
		8ebec2938c
		
	
	
	
	
		
			
			Instead of manually locking in the various member functions of Process::OpenFileDescriptions, simply wrap it in a SpinlockProtected.
		
			
				
	
	
		
			20 lines
		
	
	
	
		
			386 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
	
		
			386 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, the SerenityOS developers.
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <Kernel/Process.h>
 | |
| 
 | |
| namespace Kernel {
 | |
| 
 | |
| ErrorOr<FlatPtr> Process::sys$fsync(int fd)
 | |
| {
 | |
|     VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
 | |
|     TRY(require_promise(Pledge::stdio));
 | |
|     auto description = TRY(open_file_description(fd));
 | |
|     TRY(description->sync());
 | |
|     return 0;
 | |
| }
 | |
| 
 | |
| }
 |