* select.cc (cygwin_select): Remove select_timeout test.
(select_stuff::wait): Return select_set_zero on timeout.
(thread_socket): Report timeout when debugging.
	* include/sys/elf_common.h (R_386_16): Define.
	(R_386_PC16): Define.
	(R_386_8): Define.
	(R_386_PC8): Define.
	* regex/regcomp.c (p_ere): Allow vertical-line following
	left-parenthesis in ERE, as in glibc.
Fix last ChangeLog entry.
Add '#include "cygwait.h"' throughout, where appropriate.
* DevNotes: Add entry cgf-000012.
* Makefile.in (DLL_OFILES): Add cygwait.o.
* sigproc.h: Remove cygwait definitions.
* cygwait.h: New file.  Define/declare Cygwin waitfor functions.
* cygwait.cc: Ditto.
* exceptions.cc: Include cygwait.h.
(handle_sigsuspend): Accommodate change in cancelable_wait arguments.
(sigpacket::process): Display thread tls in debugging output.
* fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use symbolic names
for signal and cancel return.
* fhandler_console.cc (fhandler_console::read): Ditto.
(fhandler_dev_dsp::Audio_out::waitforspace): Ditto.
fhandler_dev_dsp::Audio_in::waitfordata): Ditto.
* fhandler_fifo.cc (fhandler_fifo::wait): Ditto.
* fhandler_serial.cc (fhandler_serial::raw_read): Ditto.
* fhandler_tty.cc (fhandler_pty_slave::read): Ditto.
* select.cc (cygwin_select): Ditto.
* wait.cc (wait4): Ditto.
* thread.cc (cancelable_wait): Move definition to cygwait.h.
(pthread_cond::wait): Accommodate change in cancelable_wait arguments.
(pthread_mutex::lock): Ditto.
(pthread_spinlock::lock): Ditto.
(pthread::join): Ditto.
(pthread::thread_init_wrapper): Display tls in debugging output.
(semaphore::_timedwait): Ditto.
* thread.h (cw_sig_wait): Move to cygwait.h.
(cw_cancel_action): Delete.
(cancelable_wait): Move declaration to cygwait.h.
	* cygheap.cc (init_cygheap::init_installation_root): Rearrange code
	creating valid native NT installation_root path.  Only strip last
	backslash from path if the result is a valid NT path.  Explain why.
* cygwait.cc (cancelable_wait): Mimic old cygwait behavior more closely wrt
handling of call_signal_handler.
* cygwait.h (WAIT_CANCELED): Move here and redefine.
(WAIT_SIGNALED): Ditto.
* thread.h (WAIT_CANCELED): Delete.
(WAIT_SIGNALED): Ditto.
Revert errneous checkin.
Check in actual change associated with ChangeLog.
* cygwait.h (LARGE_NULL): Define.
(cancelable_wait): Define variant which accepts DWORD time argument.
(cygwait): Use cancelable_wait with DWORD argument.
(cygwait): Use cancelable_wait with DWORD argument and cw_sig_eintr for
timeout-only case.
* exceptions.cc (handle_sigsuspend): Use LARGE_NULL as second argument to
distinguish between cancelable_wait variants.
* thread.cc (pthread_mutex::lock): Ditto.
(pthread::join): Ditto.
(semaphore::_timedwait): Ditto.
* thread.h (fast_mutex::lock): Ditto.
* wait.cc (wait4): Ditto.
	* path.cc (realpath): Call mount_info::conv_to_posix_path rather than
	mount_info::cygdrive_posix_path to convert DOS paths to POSIX paths.
	Add comment to explain why that's necessary at all.
	* path.cc (realpath): Fix comment.
* cygwait.h (cancelable_wait): Need to force time to negative to indicate
relative time.
* cygwait.cc (cancelable_wait): Make sure that timer is cancelled before
cancelling thread.
fix typo
	* winsup.h (GetLastError): Drop redundant definition.
	* advapi32.cc (_ADVAPI32_): Define.  Explain why.
	(ImpersonateNamedPipeClient): Add missing WINAPI.
	* ntdll.h (STATUS_INVALID_PARAMETER): Only define if it isn't already.
	(STATUS_DLL_NOT_FOUND): Ditto.
	(STATUS_ENTRYPOINT_NOT_FOUND): Ditto.
	(enum _EVENT_TYPE): Guard against redefinition since it's already
	defined in Mingw64's ntdef.h.
	(enum _TIMER_TYPE): Ditto.
	(enum _SECTION_INHERIT): Define if using Mingw64 headers since it's
	missing in Mingw64's ntdef.h.
	* winlean.h (__STRALIGN_H_): Define before including windows.h.
	* miscfuncs.cc (WritePipeOverlapped): Define second parameter LPCVOID,
	rather than PCVOID.
	* miscfuncs.h (WritePipeOverlapped): Ditto.
	* exceptions.cc (exception::handle): Cast exception code to NTSTATUS
	for comparison.
	* ntdll.h: Drop defining NT status codes in favor of including
	ntstatus.h.
* cygwait.h (cancelable_wait): Make extern to avoid always including.
* select.cc (allocfd_set): Try to make a little more efficient.
(cygwin_select): Break into two functions to avoid what seems to be a strange
compiler problem with alloca and sel constructor.
(select): New function.  Always honor return from call_signal_handler.
(select_stuff::wait): Always honor return from call_signal_handler.
* select.h (select_stuff::select_stuff): Use NULL to initialize pointers rather
than 0.
	* exceptions.cc (RtlUnwind): Align declaration with MSDN.
	* ntdll.h: Define CreateDisposition Flags.  Add comments.
	* winlean.h: Define FILE_SHARE_VALID_FLAGS if using Mingw64 headers.