libthread_xu: Implement stub sem_open/sem_close/sem_unlink.
authorVenkatesh Srinivas <me@endeavour.zapto.org>
Mon, 30 Jan 2012 13:04:53 +0000 (08:04 -0500)
committerVenkatesh Srinivas <me@endeavour.zapto.org>
Mon, 30 Jan 2012 13:04:53 +0000 (08:04 -0500)
The stub sem_open/sem_close/sem_unlink routines return ENOSYS; this is an
improvement over the default implementation, which returned 0 without doing
any work. libc_r already provided the stubs.

Closes: Bug #2285

lib/libthread_xu/thread/thr_sem.c

index e14c8a3..87dd932 100644 (file)
@@ -245,6 +245,27 @@ _sem_post(sem_t *sem)
        return (0);
 }
 
+sem_t *
+_sem_open(const char *name, int oflag, ...)
+{
+       errno = ENOSYS;
+       return (SEM_FAILED);
+}
+
+int
+_sem_close(sem_t *sem)
+{
+       errno = ENOSYS;
+       return (-1);
+}
+
+int
+_sem_unlink(const char *name)
+{
+       errno = ENOSYS;
+       return (-1);
+}
+
 __strong_reference(_sem_destroy, sem_destroy);
 __strong_reference(_sem_getvalue, sem_getvalue);
 __strong_reference(_sem_init, sem_init);
@@ -254,4 +275,7 @@ __strong_reference(_sem_wait, sem_wait);
 __strong_reference(_sem_timedwait, sem_timedwait);
 #endif
 __strong_reference(_sem_post, sem_post);
+__strong_reference(_sem_open, sem_open);
+__strong_reference(_sem_close, sem_close);
+__strong_reference(_sem_unlink, sem_unlink);