diff options
| author | bje <bje> | 1998-07-19 12:13:12 +0000 | 
|---|---|---|
| committer | bje <bje> | 1998-07-19 12:13:12 +0000 | 
| commit | 6a4085ee02ab8bc5fa4388cede4ee73c1994567f (patch) | |
| tree | 59a5b4b70ebf93b8aac5f410135c9fcdfebc41fd | |
| parent | 2fd4465f8ade2ce3ac46faff7d32491a328d5162 (diff) | |
1998-07-19  Ben Elliston  <bje@cygnus.com>
	* mutex.c (pthread_mutex_trylock): Return ENOSYS if this function
	is called on a Win32 platform which is not Windows NT.
| -rw-r--r-- | mutex.c | 12 | 
1 files changed, 9 insertions, 3 deletions
| @@ -147,9 +147,15 @@ pthread_mutex_unlock(pthread_mutex_t *mutex)  int  pthread_mutex_trylock(pthread_mutex_t *mutex)  { -  /* This only works on Windows NT 4.0 and above.  If this function is -     called from Windows 95, we must return ENOSYS. */ -      +  /* Typically evaluates to 31. */ +  int numbits = (sizeof(DWORD) * 8) - 1; + +  if ((GetVersion() >> numbits) != 1) +    { +      /* We're not on Windows NT; return ENOSYS. */ +      return ENOSYS; +    } +          if (mutex == NULL)      {        return EINVAL; | 
