#include "mshell.h" #include #include set_terminal_attributes() { #if 0 struct sgttyb sg; struct tchars tc; struct ltchars lt; int ldisc = NTTYDISC; ioctl ( 0, TIOCSETD, &ldisc ); ioctl ( 0, TIOCGETP, &sg ); if (access(".stty", 0) == -1) { /* not already set up */ sg.sg_erase = ''; sg.sg_kill = ''; sg.sg_flags |= XTABS; } sg.sg_flags |= ECHO; sg.sg_flags &= ~ RAW; sg.sg_flags &= ~ CBREAK; sg.sg_flags |= CRMOD; ioctl ( 0, TIOCSETP, &sg ); ioctl ( 0, TIOCGETC, &tc ); tc.t_intrc = ''; ioctl ( 0, TIOCSETC, &tc ); ioctl ( 0, TIOCGLTC, < ); lt.t_werasc = ''; lt.t_rprntc = ''; ioctl ( 0, TIOCSLTC, < ); #endif #if 1 struct termios t; tcgetattr(0, &t); t.c_cc[VINTR] = '\003'; t.c_cc[VERASE] = '\b'; t.c_cc[VKILL] = '\025'; t.c_iflag = IGNBRK | IGNPAR | ICRNL | IXON ; t.c_oflag = OPOST | ONLCR | OXTABS; t.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK ; tcsetattr(0, TCSANOW, &t); #endif } set_resource_limits() { struct rlimit lim; lim.rlim_cur = lim.rlim_max = 0; setrlimit(RLIMIT_CORE, &lim); }