MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / CanRead

Method CanRead

Kernel/src/tty/pty.cpp:135–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135bool PTYDevice::CanRead() {
136 if(device == PTYMasterDevice){
137 return !!pty->master.bufferPos;
138 } else if(device == PTYSlaveDevice){
139 if(pty->IsCanonical())
140 return !!pty->slave.lines;
141 else
142 return !!pty->slave.bufferPos;
143 } else {
144 assert(!"PTYDevice::CanRead: PTYDevice is designated neither slave nor master");
145 }
146}
147
148PTY::PTY(const char* name) : masterFile(name), slaveFile(name){
149 slaveFile.flags = FS_NODE_CHARDEVICE;

Callers 5

SysPollFunction · 0.45
SysSelectFunction · 0.45
WatchMasterMethod · 0.45
WatchSlaveMethod · 0.45
SendToMethod · 0.45

Calls 1

IsCanonicalMethod · 0.80

Tested by

no test coverage detected