From: Garrett C. <ris...@li...> - 2010-04-07 10:06:38
|
The branch, pu, has been updated via 1d67dc1564c73d49fc681679e4a5b9be48420e48 (commit) from 3bf514769d060a64d0f38f4b97c00d8bb0de74f8 (commit) - Log ----------------------------------------------------------------- commit 1d67dc1564c73d49fc681679e4a5b9be48420e48 Author: Garrett Cooper <yan...@gm...> Date: Wed Apr 7 02:50:32 2010 -0700 Add proper checks for Linux and the BSDs. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: .../conformance/interfaces/sched_yield/1-1.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c index 7437e0a..f0e1cb5 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c @@ -19,9 +19,8 @@ * 4. Launch a thread which call sched_yield() and check that the counter has * changed since the call. */ -#define LINUX -#ifdef LINUX +#ifdef __linux__ #define _GNU_SOURCE #endif @@ -35,7 +34,8 @@ #include <sys/wait.h> #include "posixtest.h" -#ifdef BSD +#ifdef __FreeBSD__ || __NetBSD__ || __OpenBSD__ +#define BSD # include <sys/types.h> # include <sys/param.h> # include <sys/sysctl.h> @@ -78,7 +78,7 @@ int get_ncpu() { return ncpu; } -#ifdef LINUX +#ifdef __linux__ int set_process_affinity(int cpu) { int retval = -1; @@ -131,7 +131,7 @@ int set_thread_affinity(int cpu) void * runner(void * arg) { int i=0, nc; long result = 0; -#ifdef LINUX +#ifdef __linux__ set_thread_affinity(*(int *)arg); fprintf(stderr, "%ld bind to cpu: %d\n", pthread_self(), *(int*)arg); #endif @@ -154,7 +154,7 @@ void * runner(void * arg) { } void * busy_thread(void *arg){ -#ifdef LINUX +#ifdef __linux__ set_thread_affinity(*(int *)arg); fprintf(stderr, "%ld bind to cpu: %d\n", pthread_self(), *(int*)arg); #endif @@ -170,7 +170,7 @@ void * busy_thread(void *arg){ void buzy_process(int cpu){ struct sched_param param; -#ifdef LINUX +#ifdef __linux__ /* Bind to a processor */ set_process_affinity(cpu); fprintf(stderr, "%d bind to cpu: %d\n", getpid(), cpu); hooks/post-receive -- ltp |