Rev 2479 | Rev 3747 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2479 | Rev 3224 | ||
---|---|---|---|
Line 94... | Line 94... | ||
94 | rwait(struct timeval *tvp) |
94 | rwait(struct timeval *tvp) |
95 | { |
95 | { |
96 | struct timeval starttv, endtv, *s; |
96 | struct timeval starttv, endtv, *s; |
97 | static ipc_call_t charcall; |
97 | static ipc_call_t charcall; |
98 | ipcarg_t rc; |
98 | ipcarg_t rc; |
- | 99 | int cons_phone; |
|
99 | 100 | ||
100 | /* |
101 | /* |
101 | * Someday, select() will do this for us. |
102 | * Someday, select() will do this for us. |
102 | * Just in case that day is now, and no one has |
103 | * Just in case that day is now, and no one has |
103 | * changed this, we use a temporary. |
104 | * changed this, we use a temporary. |
Line 108... | Line 109... | ||
108 | s = &endtv; |
109 | s = &endtv; |
109 | } else |
110 | } else |
110 | s = NULL; |
111 | s = NULL; |
111 | 112 | ||
112 | if (!lastchar) { |
113 | if (!lastchar) { |
113 | if (!getchar_inprog) |
114 | if (!getchar_inprog) { |
- | 115 | cons_phone = get_cons_phone(); |
|
114 | getchar_inprog = async_send_2(1,CONSOLE_GETCHAR,0,0,&charcall); |
116 | getchar_inprog = async_send_2(cons_phone, |
- | 117 | CONSOLE_GETCHAR, 0, 0, &charcall); |
|
- | 118 | } |
|
115 | if (!s) |
119 | if (!s) |
116 | async_wait_for(getchar_inprog, &rc); |
120 | async_wait_for(getchar_inprog, &rc); |
117 | else if (async_wait_timeout(getchar_inprog, &rc, s->tv_usec) == ETIMEOUT) { |
121 | else if (async_wait_timeout(getchar_inprog, &rc, s->tv_usec) == ETIMEOUT) { |
118 | tvp->tv_sec = 0; |
122 | tvp->tv_sec = 0; |
119 | tvp->tv_usec = 0; |
123 | tvp->tv_usec = 0; |