mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:22:45 +00:00 
			
		
		
		
	Kernel: Let the user read/write more than one page from/to dev files
Previously reads and writes to /dev/zero, /dev/full, /dev/null and /dev/random were limited to 4096 bytes. This removes that restriction so that users can enjoy more zero bytes in their buffers.
This commit is contained in:
		
							parent
							
								
									a272c04c8a
								
							
						
					
					
						commit
						1ce32ef675
					
				
					 4 changed files with 7 additions and 9 deletions
				
			
		|  | @ -28,10 +28,9 @@ bool FullDevice::can_read(const FileDescription&, size_t) const | |||
| 
 | ||||
| KResultOr<size_t> FullDevice::read(FileDescription&, u64, UserOrKernelBuffer& buffer, size_t size) | ||||
| { | ||||
|     ssize_t count = min(static_cast<size_t>(PAGE_SIZE), size); | ||||
|     if (!buffer.memset(0, count)) | ||||
|     if (!buffer.memset(0, size)) | ||||
|         return EFAULT; | ||||
|     return count; | ||||
|     return size; | ||||
| } | ||||
| 
 | ||||
| KResultOr<size_t> FullDevice::write(FileDescription&, u64, const UserOrKernelBuffer&, size_t size) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Gunnar Beutner
						Gunnar Beutner