static char sccsid
[] = "@(#)main.c 4.6 (Berkeley) 83/12/13";
* getty -- adapt to terminal speed on dialup, and call login
* Melbourne getty, June 83, kre.
0001,0201,0201,0001,0201,0001,0001,0201,
0202,0004,0003,0205,0005,0206,0201,0001,
0201,0001,0001,0201,0001,0201,0201,0001,
0001,0201,0201,0001,0201,0001,0001,0201,
0200,0000,0000,0200,0000,0200,0200,0000,
0000,0200,0200,0000,0200,0000,0000,0200,
0000,0200,0200,0000,0200,0000,0000,0200,
0200,0000,0000,0200,0000,0200,0200,0000,
0200,0000,0000,0200,0000,0200,0200,0000,
0000,0200,0200,0000,0200,0000,0000,0200,
0000,0200,0200,0000,0200,0000,0000,0200,
0200,0000,0000,0200,0000,0200,0200,0000,
0000,0200,0200,0000,0200,0000,0000,0200,
0200,0000,0000,0200,0000,0200,0200,0000,
0200,0000,0000,0200,0000,0200,0200,0000,
0000,0200,0200,0000,0200,0000,0000,0201
#define ERASE tmode.sg_erase
#define KILL tmode.sg_kill
signal(SIGALRM
, SIG_DFL
);
signal(SIGINT
, interrupt
);
signal(SIGQUIT, SIG_DFL);
gethostname(hostname
, sizeof(hostname
));
strcpy(hostname
, "Amnesiac");
gettable("default", defent
, defstrs
);
gettable(tname
, tabent
, tabstrs
);
if (OPset
|| EPset
|| APset
)
APset
++, OPset
++, EPset
++;
ioctl(0, TIOCFLUSH
, 0); /* clear out the crap */
tmode
.sg_ispeed
= speed(IS
);
tmode
.sg_ispeed
= speed(SP
);
tmode
.sg_ospeed
= speed(OS
);
tmode
.sg_ospeed
= speed(SP
);
tmode
.sg_flags
= setflags(0);
ioctl(0, TIOCSETP
, &tmode
);
ioctl(0, TIOCSETD
, &ldisp
);
tmode
.sg_ispeed
= tmode
.sg_ospeed
= 0;
ioctl(0, TIOCSETP
, &tmode
);
signal(SIGALRM
, dingdong
);
signal(SIGALRM
, SIG_DFL
);
if (!(upper
|| lower
|| digit
))
tmode
.sg_flags
= allflags
& 0xffff;
tmode
.sg_flags
&= ~LCASE
;
ioctl(0, TIOCSETP
, &tmode
);
ioctl(0, TIOCSLTC
, <c
);
ioctl(0, TIOCLSET
, &allflags
);
execle(LO
, "login", name
, (char *)0, env
);
signal(SIGALRM
, SIG_DFL
);
* Interrupt may happen if we use CBREAK mode
signal(SIGINT
, interrupt
);
tmode
.sg_flags
= setflags(0);
ioctl(0, TIOCSETP
, &tmode
);
tmode
.sg_flags
= setflags(1);
ioctl(0, TIOCSETP
, &tmode
);
if (read(0, &cs
, 1) <= 0)
if (c
== '\r' || c
== '\n' || np
>= &name
[16])
if (c
>= 'a' && c
<= 'z')
else if (c
>= 'A' && c
<= 'Z') {
} else if (c
== ERASE
|| c
== '#' || c
== '\b') {
if (tmode
.sg_ospeed
>= B1200
)
} else if (c
== KILL
|| c
== '@') {
if (tmode
.sg_ospeed
< B1200
)
/* this is the way they do it down under ... */
else if (c
>= '0' && c
<= '9')
if (IG
&& (c
< ' ' || c
> 0176))
if (upper
&& !lower
&& !LC
|| UC
)
for (np
= name
; *np
; np
++)
0, 2000, 1333, 909, 743, 666, 500, 333, 166, 83, 55, 41, 20, 10, 5, 15
if (*s
== '.' && isdigit(s
[1])) {
* If no delay needed, or output speed is
* not comprehensible, then don't try to delay.
if (tmode
.sg_ospeed
<= 0 ||
tmode
.sg_ospeed
>= (sizeof tmspc10
/ sizeof tmspc10
[0]))
* Round up by a half a character frame,
* Too bad there are no user program accessible programmed delays.
* Transmitting pad characters slows many
* terminals down and also loads the system.
mspc10
= tmspc10
[tmode
.sg_ospeed
];
for (pad
/= mspc10
; pad
> 0; pad
--)
c
|= partab
[c
&0177] & 0200;
write(1, outbuf
, obufcnt
);
extern char editedhost
[];
if (strncmp(tp
, "/dev/", 5) == 0)