* cygerrno.h (geterrno_from_nt_status): Declare.

* errno.cc (geterrno_from_nt_status): Define.
	* flock.cc: Fix copyright dates.
	* ntdll.h (enum _TIMER_TYPE): Define.
	(PTIMER_APC_ROUTINE): Define.
	(NtCancelTimer): Declare.
	(NtCreateTimer): Declare.
	(NtSetTimer): Declare.
	* posix_ipc.cc (ipc_cond_timedwait): Rewrite to make interruptible and
	restartable.  Call pthread_testcancel in case of timeout to enable
	pthread_cancel on waiting thread.  Replace WFMO timeout with waiting
	for a waitable timer.  Explain why.  Replace single call to WFMO with
	two calls, one for the event, one for the mutex.  Don't lock mutex in
	case of error.
	(ipc_cond_signal): Make void function.
	(ipc_cond_close): Ditto.
	(_mq_send): Immediately return -1 in case of error from
	ipc_cond_timedwait.
	(_mq_receive): Ditto.
This commit is contained in:
Corinna Vinschen
2011-04-28 12:13:41 +00:00
parent 1838d97b0a
commit 86bf572ef0
6 changed files with 127 additions and 36 deletions

View File

@@ -327,6 +327,12 @@ seterrno_from_win_error (const char *file, int line, DWORD code)
errno = _impure_ptr->_errno = geterrno_from_win_error (code, EACCES);
}
int __stdcall
geterrno_from_nt_status (NTSTATUS status, int deferrno)
{
return geterrno_from_win_error (RtlNtStatusToDosError (status));
}
/* seterrno_from_nt_status: Given a NT status code, set errno
as appropriate. */
void __stdcall