Hello,

While trying to use jackd on a ARM926 I get a runtime error caused by
the missing clock_nanosleep symbol. After having verified that the
clock_nanosleep syscall is present into the kernel, I cam to the
conclusion that the librt from uclibc simply lack the clock_nanosleep()
declaration. So I wrote this simple patch to try, and it actually seem
to work perfectly well on the target: jackd start and work as expected.

--- /dev/null   2010-03-02 08:54:51.506676601 +0100
+++ b/librt/clock_nanosleep.c   2010-03-02 11:26:15.000000000 +0100
@@ -0,0 +1,23 @@
+#include <errno.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sys/syscall.h>
+
+#include "kernel-posix-timers.h"
+
+#ifdef __NR_clock_nanosleep
+
+#define __NR___syscall_clock_nanosleep __NR_clock_nanosleep
+static __inline__ _syscall4(long, __syscall_clock_nanosleep,
+                           clockid_t, clock_id, int, flags,
+                           const struct timespec *, req,
+                           struct timespec *, rem);
+
+long clock_nanosleep(clockid_t clock_id, int flags,
+                   const struct timespec *req,
+                   struct timespec *rem)
+{
+       return __syscall_clock_nanosleep(clock_id, flags, req, rem);
+}
+
+#endif


I don't know if this patch is good enough, so I am open to any comment
about it.

Regards,

Jean-Christian de Rivaz
--- /dev/null	2010-03-02 08:54:51.506676601 +0100
+++ b/librt/clock_nanosleep.c	2010-03-02 11:26:15.000000000 +0100
@@ -0,0 +1,23 @@
+#include <errno.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sys/syscall.h>
+
+#include "kernel-posix-timers.h"
+
+#ifdef __NR_clock_nanosleep
+
+#define __NR___syscall_clock_nanosleep __NR_clock_nanosleep
+static __inline__ _syscall4(long, __syscall_clock_nanosleep,
+			    clockid_t, clock_id, int, flags,
+			    const struct timespec *, req,
+			    struct timespec *, rem);
+
+long clock_nanosleep(clockid_t clock_id, int flags,
+		    const struct timespec *req,
+		    struct timespec *rem)
+{
+	return __syscall_clock_nanosleep(clock_id, flags, req, rem);
+}
+
+#endif
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to