- clt->stdin = _SysOpen("/Devices/fifo/anon", OPENFLAG_READ|OPENFLAG_WRITE);
- clt->stdout = _SysOpen("/Devices/fifo/anon", OPENFLAG_READ|OPENFLAG_WRITE);
+ clt->pty = _SysOpen("/Devices/pts/ptmx", OPENFLAG_READ|OPENFLAG_WRITE);
+ if( clt->pty < 0 ) {
+ perror("Unable to create/open PTY");
+ _SysDebug("Unable to create/open PTY: %s", strerror(errno));
+ _SysClose(clt->Socket);
+ clt->Socket = 0;
+ return ;
+ }
+ // - Initialise
+ {
+ _SysIOCtl(clt->pty, PTY_IOCTL_SETID, "telnetd0");
+ struct ptymode mode = {.InputMode = 0, .OutputMode=0};
+ struct ptydims dims = {.W = 80, .H = 25};
+ _SysIOCtl(clt->pty, PTY_IOCTL_SETMODE, &mode);
+ _SysIOCtl(clt->pty, PTY_IOCTL_SETDIMS, &dims);
+ }