1 |
/* |
/* main.c - A translator that emulates a terminal. |
2 |
Copyright (C) 1995, 1996, 1997, 2000, 2002 Free Software Foundation, Inc. |
Copyright (C) 1995, 1996, 1997, 2000, 2002 Free Software Foundation, Inc. |
3 |
Written by Michael I. Bushnell, p/BSG. |
Written by Michael I. Bushnell, p/BSG. |
4 |
|
|
84 |
|
|
85 |
rdev = strtoul (start, &end, 0); |
rdev = strtoul (start, &end, 0); |
86 |
if (*end == ',') |
if (*end == ',') |
|
/* MAJOR,MINOR form */ |
|
87 |
{ |
{ |
88 |
|
/* MAJOR,MINOR form. */ |
89 |
start = end; |
start = end; |
90 |
rdev = (rdev << 8) + strtoul (start, &end, 0); |
rdev = (rdev << 8) + strtoul (start, &end, 0); |
91 |
} |
} |
206 |
|
|
207 |
default: |
default: |
208 |
/* Should not happen. */ |
/* Should not happen. */ |
209 |
fprintf (stderr, "Unknown terminal type is unknown.\n"); |
fprintf (stderr, "Unknown terminal type\n"); |
210 |
exit (1); |
exit (1); |
211 |
} |
} |
212 |
|
|
218 |
exit (1); |
exit (1); |
219 |
} |
} |
220 |
|
|
221 |
/* Set our node */ |
/* Set our node. */ |
222 |
errno = trivfs_startup (bootstrap, 0, |
errno = trivfs_startup (bootstrap, 0, |
223 |
ourcntlclass, term_bucket, ourclass, term_bucket, |
ourcntlclass, term_bucket, ourclass, term_bucket, |
224 |
ourcntl); |
ourcntl); |
232 |
the hook to store the nodename. */ |
the hook to store the nodename. */ |
233 |
(*ourcntl)->hook = tty_name; |
(*ourcntl)->hook = tty_name; |
234 |
|
|
235 |
/* Set peer */ |
/* Set peer. */ |
236 |
if (peerclass) |
if (peerclass) |
237 |
{ |
{ |
238 |
char *peer_name = tty_arg; |
char *peer_name = tty_arg; |
262 |
ports_port_deref (*peercntl); |
ports_port_deref (*peercntl); |
263 |
} |
} |
264 |
|
|
265 |
bzero (&termstate, sizeof (termstate)); |
memset (&termstate, 0, sizeof (termstate)); |
266 |
termflags = NO_CARRIER | NO_OWNER; |
termflags = NO_CARRIER | NO_OWNER; |
267 |
mutex_init (&global_lock); |
mutex_init (&global_lock); |
268 |
|
|
301 |
condition_implies (inputq->wait, &select_alert); |
condition_implies (inputq->wait, &select_alert); |
302 |
condition_implies (outputq->wait, &select_alert); |
condition_implies (outputq->wait, &select_alert); |
303 |
|
|
304 |
/* Launch */ |
/* Launch. */ |
305 |
ports_manage_port_operations_multithread (term_bucket, demuxer, 0, 0, 0); |
ports_manage_port_operations_multithread (term_bucket, demuxer, 0, 0, 0); |
306 |
|
|
307 |
return 0; |
return 0; |