summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/include/semaphore.h
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-03-03 10:02:26 +0000
committerguenther <guenther@openbsd.org>2012-03-03 10:02:26 +0000
commit37ebc96dae665e2e69a41843fc69ae66273ce898 (patch)
treef1be9a6efbf5702df0235969bc113eb4c9fe5c29 /lib/libpthread/include/semaphore.h
parentVerify that sem_wait() doesn't return zero without decrementing the (diff)
downloadwireguard-openbsd-37ebc96dae665e2e69a41843fc69ae66273ce898.tar.xz
wireguard-openbsd-37ebc96dae665e2e69a41843fc69ae66273ce898.zip
Add sem_timewait() and fix sem_wait()'s handling of signals, so
that it resumes waiting unless the thread was canceled. As part of this, change the internal _sem_wait() function to return zero on success and an errno value on failure instead of 1 on success and zero on failure.
Diffstat (limited to 'lib/libpthread/include/semaphore.h')
-rw-r--r--lib/libpthread/include/semaphore.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libpthread/include/semaphore.h b/lib/libpthread/include/semaphore.h
index 4735f9c29f9..08d659b3854 100644
--- a/lib/libpthread/include/semaphore.h
+++ b/lib/libpthread/include/semaphore.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: semaphore.h,v 1.3 2002/02/16 21:27:25 millert Exp $ */
+/* $OpenBSD: semaphore.h,v 1.4 2012/03/03 10:02:26 guenther Exp $ */
/* semaphore.h: POSIX 1003.1b semaphores */
@@ -58,6 +58,7 @@ sem_t *sem_open(const char *, int, ...);
int sem_close(sem_t *);
int sem_unlink(const char *);
int sem_wait(sem_t *);
+int sem_timedwait(sem_t *, const struct timespec *);
int sem_trywait(sem_t *);
int sem_post(sem_t *);
int sem_getvalue(sem_t *, int *);