mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 02:22:43 +00:00 
			
		
		
		
	 c6f2890d8e
			
		
	
	
		c6f2890d8e
		
	
	
	
	
		
			
			FileHandle gets a hasDataAvailableForRead() getter. If this returns true in sys$read(), the task will block(BlockedRead) + yield. The fd blocked on is stored in Task::m_fdBlockedOnRead. The scheduler then looks at the state of that fd during the unblock phase. This makes "sh" restful. :^) There's still some problem with the kernel not surviving the colonel task getting scheduled. I need to figure that out and fix it.
		
			
				
	
	
		
			14 lines
		
	
	
	
		
			387 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
	
		
			387 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include "CharacterDevice.h"
 | |
| 
 | |
| class NullDevice final : public CharacterDevice {
 | |
| public:
 | |
|     NullDevice();
 | |
|     virtual ~NullDevice() override;
 | |
| 
 | |
|     virtual Unix::ssize_t read(byte* buffer, Unix::size_t bufferSize) override;
 | |
|     virtual Unix::ssize_t write(const byte* buffer, Unix::size_t bufferSize) override;
 | |
|     virtual bool hasDataAvailableForRead() const override;
 | |
| };
 | |
| 
 |