From 3c6cc4a04f012b87e0b3e209aa33e372012cd6ee Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 9 Aug 2001 22:26:51 +0000 Subject: 2001-08-09 Fernando-Ruiz Casas * shell/pty.c: Moved to libnetworking/rtems_telnetd. --- c/src/libmisc/shell/pty.c | 406 ---------------------------------------------- 1 file changed, 406 deletions(-) delete mode 100644 c/src/libmisc/shell/pty.c (limited to 'c/src/libmisc/shell/pty.c') diff --git a/c/src/libmisc/shell/pty.c b/c/src/libmisc/shell/pty.c deleted file mode 100644 index d6077a566a..0000000000 --- a/c/src/libmisc/shell/pty.c +++ /dev/null @@ -1,406 +0,0 @@ -/* - * /dev/ptyXX (A first version for pseudo-terminals) - * - * Author: Fernando RUIZ CASAS (fernando.ruiz@ctv.es) - * May 2001 - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ -/*-----------------------------------------*/ -#include -#include -#include -#include -/*-----------------------------------------*/ -#include -#include -#include -#include -/*-----------------------------------------*/ -#define IAC_ESC 255 -#define IAC_DONT 254 -#define IAC_DO 253 -#define IAC_WONT 252 -#define IAC_WILL 251 -#define IAC_SB 250 -#define IAC_GA 249 -#define IAC_EL 248 -#define IAC_EC 247 -#define IAC_AYT 246 -#define IAC_AO 245 -#define IAC_IP 244 -#define IAC_BRK 243 -#define IAC_DMARK 242 -#define IAC_NOP 241 -#define IAC_SE 240 -#define IAC_EOR 239 - -struct pty_tt; -typedef struct pty_tt pty_t; - -struct pty_tt { - char *devname; - struct rtems_termios_tty *ttyp; - tcflag_t c_cflag; - int opened; - int socket; - - int last_cr; - int iac_mode; -}; - -#define MAX_PTYS 16 - -pty_t ptys[MAX_PTYS]; - -/* This procedure returns the devname for a pty slot free. - * If not slot availiable (field socket>=0) - * then the socket argument is closed - */ - -char * get_pty(int socket) { - int ndx; - for (ndx=0;ndxc_cflag; - } else { - return -1; - }; - return 0; -} -/*-----------------------------------------------------------*/ -static int -ptyPollInitialize(int major,int minor,void * arg) { - rtems_libio_open_close_args_t * args = arg; - struct termios t; - if (minoriop->data1; - t.c_cflag=B9600|CS8;/* termios default */ - return ptySetAttributes(minor,&t); - } else { - return -1; - }; -} -/*-----------------------------------------------------------*/ -static int -ptyShutdown(int major,int minor,void * arg) { - if (minor=0) close(ptys[minor].socket); - ptys[minor].socket=-1; - chown(ptys[minor].devname,2,0); - } else { - return -1; - }; - return 0; -} -/*-----------------------------------------------------------*/ -/* Write Characters into pty device */ -/*-----------------------------------------------------------*/ -static int -ptyPollWrite(int minor, const char * buf,int len) { - int count; - if (minor