* [Xenomai-core] [RFC][PATCH] link-check sched_setaffinity
@ 2007-06-12 18:21 Jan Kiszka
0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2007-06-12 18:21 UTC (permalink / raw)
To: Gilles Chanteperdrix, Philippe Gerum; +Cc: xenomai-core
[-- Attachment #1.1: Type: text/plain, Size: 261 bytes --]
Hi,
as indicated earlier, there is an issue with uClibc from the blackfin
distribution: AC_TRY_COMPILE succeeds, but linking later on fails.
So my suggestion is to try to link already during configure (and test
for missing defines differently).
Jan
[-- Attachment #1.2: link-check-sched_setaffinity.patch --]
[-- Type: text/plain, Size: 2075 bytes --]
Index: configure.in
===================================================================
--- configure.in (Revision 2571)
+++ configure.in (Arbeitskopie)
@@ -516,12 +516,12 @@
AC_CACHE_VAL(ac_cv_sched_setaffinity,
save_CFLAGS="$CFLAGS"
CFLAGS="-Wimplicit-function-declaration -Werror -D_GNU_SOURCE"
- [AC_TRY_COMPILE([#include <sched.h>],
+ [AC_TRY_LINK([#include <sched.h>],
[cpu_set_t cpu_set; sched_setaffinity(0, sizeof(cpu_set), &cpu_set);],
[ac_cv_sched_setaffinity=new],
[ac_cv_sched_setaffinity=bad])]
if test $ac_cv_sched_setaffinity = bad ; then
- [AC_TRY_COMPILE([#include <sched.h>],
+ [AC_TRY_LINK([#include <sched.h>],
[cpu_set_t cpu_set; sched_setaffinity(0, &cpu_set);],
[ac_cv_sched_setaffinity=old],
[ac_cv_sched_setaffinity=no])]
Index: src/testsuite/switchtest/switchtest.c
===================================================================
--- src/testsuite/switchtest/switchtest.c (Revision 2571)
+++ src/testsuite/switchtest/switchtest.c (Arbeitskopie)
@@ -27,8 +27,10 @@
typedef unsigned long cpu_set_t;
#endif
#define do_sched_setaffinity(pid,len,mask) 0
+#ifndef CPU_ZERO
#define CPU_ZERO(set) do { *(set) = 0; } while(0)
#define CPU_SET(n,set) do { *(set) |= (1 << n); } while(0)
+#endif
#endif /* HAVE_OLD_SETAFFINITY */
#endif /* HAVE_RECENT_SETAFFINITY */
Index: src/testsuite/clocktest/clocktest.c
===================================================================
--- src/testsuite/clocktest/clocktest.c (Revision 2571)
+++ src/testsuite/clocktest/clocktest.c (Arbeitskopie)
@@ -18,6 +18,7 @@
#include <errno.h>
#include <pthread.h>
+#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -35,8 +36,10 @@
typedef unsigned long cpu_set_t;
#endif
#define sched_setaffinity(pid, len, mask) do { } while (0)
+#ifndef CPU_ZERO
#define CPU_ZERO(set) memset(set, 0, sizeof(*set))
#define CPU_SET(n, set) do { } while (0)
+#endif
#endif /* !HAVE_OLD_SETAFFINITY */
#endif /* !HAVE_RECENT_SETAFFINITY */
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-06-12 18:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-12 18:21 [Xenomai-core] [RFC][PATCH] link-check sched_setaffinity Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.