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

Method PTY

Kernel/src/tty/pty.cpp:148–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148PTY::PTY(const char* name) : masterFile(name), slaveFile(name){
149 slaveFile.flags = FS_NODE_CHARDEVICE;
150
151 master.ignoreBackspace = true;
152 slave.ignoreBackspace = false;
153 master.Flush();
154 slave.Flush();
155 tios.c_lflag = ECHO | ICANON;
156
157 masterFile.pty = this;
158 masterFile.device = PTYMasterDevice;
159
160 slaveFile.pty = this;
161 slaveFile.device = PTYSlaveDevice;
162
163 for(int i = 0; i < NCCS; i++) tios.c_cc[i] = c_cc_default[i];
164
165 DeviceManager::RegisterDevice(slaveFile);
166
167 ptys->add_back(this);
168}
169
170size_t PTY::Master_Read(char* buffer, size_t count){
171 return master.Read(buffer, count);

Callers

nothing calls this directly

Calls 3

RegisterDeviceFunction · 0.85
FlushMethod · 0.80
add_backMethod · 0.45

Tested by

no test coverage detected