| 81 | } |
| 82 | |
| 83 | int 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 | |
| 115 | void PTYDevice::Watch(FilesystemWatcher& watcher, int events){ |
| 116 | if(device == PTYMasterDevice){ |
nothing calls this directly
no test coverage detected