243 |
{ |
{ |
244 |
while (writer_thread != MACH_PORT_NULL |
while (writer_thread != MACH_PORT_NULL |
245 |
&& (ioport == MACH_PORT_NULL || !qsize (outputq) |
&& (ioport == MACH_PORT_NULL || !qsize (outputq) |
246 |
|| (termflags & USER_OUTPUT_SUSP))) |
|| output_stopped)) |
247 |
hurd_condition_wait (&hurdio_writer_condition, &global_lock); |
hurd_condition_wait (&hurdio_writer_condition, &global_lock); |
248 |
if (writer_thread == MACH_PORT_NULL) /* A sign to die. */ |
if (writer_thread == MACH_PORT_NULL) /* A sign to die. */ |
249 |
return 0; |
return 0; |
250 |
|
|
|
/* If the output was suspended earlier, we have to tell the |
|
|
underlying port to resume it. */ |
|
|
if (output_stopped) |
|
|
{ |
|
|
if (tioc_caps & TIOC_CAP_START) |
|
|
{ |
|
|
err = tioctl_tiocstart (ioport); |
|
|
if (err && (err == EMIG_BAD_ID || err == EOPNOTSUPP)) |
|
|
tioc_caps &= ~TIOC_CAP_START; |
|
|
/* XXX Handle the error. */ |
|
|
err = 0; |
|
|
} |
|
|
output_stopped = 0; |
|
|
} |
|
|
|
|
251 |
/* Copy characters onto PENDING_OUTPUT, not bothering |
/* Copy characters onto PENDING_OUTPUT, not bothering |
252 |
those already there. */ |
those already there. */ |
253 |
size = qsize (outputq); |
size = qsize (outputq); |
308 |
static error_t |
static error_t |
309 |
hurdio_start_output () |
hurdio_start_output () |
310 |
{ |
{ |
311 |
|
/* If the output was suspended earlier and not anymore, we have to |
312 |
|
tell the underlying port to resume it. */ |
313 |
|
if (output_stopped && !(termflags & USER_OUTPUT_SUSP)) |
314 |
|
{ |
315 |
|
if (tioc_caps & TIOC_CAP_START) |
316 |
|
{ |
317 |
|
error_t err = tioctl_tiocstart (ioport); |
318 |
|
if (err && (err == EMIG_BAD_ID || err == EOPNOTSUPP)) |
319 |
|
tioc_caps &= ~TIOC_CAP_START; |
320 |
|
} |
321 |
|
output_stopped = 0; |
322 |
|
} |
323 |
condition_broadcast (&hurdio_writer_condition); |
condition_broadcast (&hurdio_writer_condition); |
324 |
return 0; |
return 0; |
325 |
} |
} |