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

Method Ioctl

Kernel/src/tty/pty.cpp:83–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83int PTYDevice::Ioctl(uint64_t cmd, uint64_t arg){
84 assert(pty);
85
86 switch(cmd){
87 case TIOCGWINSZ:
88 *((winsz*)arg) = pty->wSz;
89 break;
90 case TIOCSWINSZ:
91 pty->wSz = *((winsz*)arg);
92 break;
93 case TIOCGATTR:
94 *((termios*)arg) = pty->tios;
95 break;
96 case TIOCSATTR:
97 pty->tios = *((termios*)arg);
98 pty->slave.ignoreBackspace = !pty->IsCanonical();
99 break;
100 case TIOCFLUSH:
101 if(arg == TCIFLUSH || arg == TCIOFLUSH){
102 pty->slave.Flush();
103 }
104 if(arg == TCOFLUSH || arg == TCIOFLUSH){
105 pty->master.Flush();
106 }
107 break;
108 default:
109 return -1;
110 }
111
112 return 0;
113}
114
115void PTYDevice::Watch(FilesystemWatcher& watcher, int events){
116 if(device == PTYMasterDevice){

Callers

nothing calls this directly

Calls 2

IsCanonicalMethod · 0.80
FlushMethod · 0.80

Tested by

no test coverage detected