- /*
- * Create a separate thread to read from stdin. This is
- * a total pain, but I can't find another way to do it:
- *
- * - an overlapped ReadFile or ReadFileEx just doesn't
- * happen; we get failure from ReadFileEx, and
- * ReadFile blocks despite being given an OVERLAPPED
- * structure. Perhaps we can't do overlapped reads
- * on consoles. WHY THE HELL NOT?
- *
- * - WaitForMultipleObjects(netevent, console) doesn't
- * work, because it signals the console when
- * _anything_ happens, including mouse motions and
- * other things that don't cause data to be readable
- * - so we're back to ReadFile blocking.
- */
- idata.event = stdinevent;
- idata.eventback = CreateEvent(NULL, FALSE, FALSE, NULL);
- if (!CreateThread(NULL, 0, stdin_read_thread,
- &idata, 0, &in_threadid)) {
- fprintf(stderr, "Unable to create input thread\n");
- cleanup_exit(1);
- }