summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--mutex.c4
-rw-r--r--semaphore.c4
3 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f29b217..5b7fb08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2002-02-01 Ross Johnson <rpj@setup1.ise.canberra.edu.au>
+
+ * semaphore.c (sem_trywait): Fix missing errno return
+ for systems that define NEED_SEM (e.g. early WinCE).
+ * mutex.c (pthread_mutex_timedlock): Return ENOTSUP
+ for systems that define NEED_SEM since they don't
+ have sem_trywait().
+
2002-01-27 Ross Johnson <rpj@special.ise.canberra.edu.au>
* mutex.c (pthread_mutex_timedlock): New function suggested by
diff --git a/mutex.c b/mutex.c
index 72847d5..85fdab4 100644
--- a/mutex.c
+++ b/mutex.c
@@ -835,6 +835,10 @@ pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abstime)
int result = 0;
pthread_mutex_t mx;
+#ifdef NEED_SEM
+ errno = ENOTSUP;
+ return -1;
+#endif
if (mutex == NULL || *mutex == NULL)
{
diff --git a/semaphore.c b/semaphore.c
index 54005db..86222ec 100644
--- a/semaphore.c
+++ b/semaphore.c
@@ -258,7 +258,7 @@ sem_trywait (sem_t * sem)
* ERRNO
* EAGAIN the semaphore was already locked,
* EINVAL 'sem' is not a valid semaphore,
- * ENOSYS semaphores are not supported,
+ * ENOTSUP sem_trywait is not supported,
* EINTR the function was interrupted by a signal,
* EDEADLK a deadlock condition was detected.
*
@@ -270,7 +270,7 @@ sem_trywait (sem_t * sem)
/*
* not yet implemented!
*/
- int result = EINVAL;
+ errno = ENOTSUP;
return -1;
#else /* NEED_SEM */