4 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
9 static char rcsid[] = "$Id$";
13 * Revision 1.4 2008/02/15 16:48:56 james
14 * *** empty log message ***
16 * Revision 1.3 2008/02/15 03:32:07 james
17 * *** empty log message ***
19 * Revision 1.2 2008/02/14 16:21:17 james
20 * *** empty log message ***
22 * Revision 1.1 2008/02/14 12:51:14 james
23 * *** empty log message ***
25 * Revision 1.4 2008/02/14 10:39:14 james
26 * *** empty log message ***
28 * Revision 1.3 2008/02/13 09:12:21 james
29 * *** empty log message ***
31 * Revision 1.2 2008/02/12 22:36:46 james
32 * *** empty log message ***
34 * Revision 1.1 2008/02/09 15:47:28 james
35 * *** empty log message ***
37 * Revision 1.2 2008/02/07 11:11:14 staffcvs
38 * *** empty log message ***
40 * Revision 1.1 2008/02/07 01:02:52 james
41 * *** empty log message ***
43 * Revision 1.3 2008/02/06 17:53:28 james
44 * *** empty log message ***
46 * Revision 1.2 2008/02/04 02:05:06 james
47 * *** empty log message ***
49 * Revision 1.1 2008/02/04 01:32:39 james
50 * *** empty log message ***
63 char *lockfiles[NLOCKFILES];
64 char *potential_lockfiles[NLOCKFILES];
65 struct timeval last_content_check;
77 serial_check_lock (Serial * t)
83 serial_close (TTY * _t)
85 Serial *t = (Serial *) _t;
97 serial_read (TTY * _t, void *buf, int len)
99 Serial *t = (Serial *) _t;
102 serial_check_lock (t);
109 red = wrap_read (t->fd, buf, len);
127 ptty_write (TTY * _t, void *buf, int len)
130 Serial *t = (Serial *) _t;
132 serial_check_lock (t);
139 writ = wrap_write (t->fd, buf, len);
156 serial_open (char *path)
161 struct winsize winsize = { 0 };
162 struct termios termios;
166 default_termios (&termios);
168 fd = open (path, O_RDWR);
170 set_nonblocking (fd);
172 t = (Serial *) malloc (sizeof (Serial));
174 strncpy (t->name, path, sizeof (t->name));
175 t->name[sizeof (t->name) - 1] = 0;
177 t->recv = serial_read;
178 //t->xmit = serial_write;
179 t->close = serial_close;
183 t->size.x = VT102_COLS;
184 t->size.y = VT102_ROWS;