linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cyclictest: fix #ifdef broken by NO_PTHREAD_SETAFFINITY
@ 2015-10-21 16:34 John Kacur
  2015-10-21 18:13 ` Henrik Austad
  0 siblings, 1 reply; 2+ messages in thread
From: John Kacur @ 2015-10-21 16:34 UTC (permalink / raw)
  To: linux-rt-users; +Cc: Clark Williams, Henrik Austad

>From 73bc7345eebb2244efc527928fdac7b8e29193cd Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Wed, 21 Oct 2015 18:25:37 +0200
Subject: [PATCH] cyclictest: fix #ifdef broken by NO_PTHREAD_SETAFFINITY

Unfortunately c869f3cdcd023eec2f767eb4094caa88178717a4 wasn't sufficient
to fix #ifdef #else functionality for uclib, broken by the changes for
bionic.

In practice this probably didn't break anyone though, except possibly
for the new bionic code which probaly doesn't have too many adapters
(yet).

This should also help Henrik move the NO_PTHREAD_SETAFFINITY functionality to
the bionic file.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/cyclictest/cyclictest.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 00168e22fc7f..975e7858fb8e 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -83,6 +83,10 @@ int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
 #define CPU_SET(cpu, cpusetp)
 #define CPU_ZERO(cpusetp)
 
+#else
+extern int clock_nanosleep(clockid_t __clock_id, int __flags,
+			   __const struct timespec *__req,
+			   struct timespec *__rem);
 #endif
 
 #ifdef NO_PTHREAD_SETAFFINITY
@@ -91,11 +95,6 @@ static inline int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize,
 {
     return sched_setaffinity(0, cpusetsize, cpuset);
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cyclictest: fix #ifdef broken by NO_PTHREAD_SETAFFINITY
  2015-10-21 16:34 [PATCH] cyclictest: fix #ifdef broken by NO_PTHREAD_SETAFFINITY John Kacur
@ 2015-10-21 18:13 ` Henrik Austad
  0 siblings, 0 replies; 2+ messages in thread
From: Henrik Austad @ 2015-10-21 18:13 UTC (permalink / raw)
  To: John Kacur; +Cc: linux-rt-users, Clark Williams, Henrik Austad

[-- Attachment #1: Type: text/plain, Size: 2250 bytes --]

On Wed, Oct 21, 2015 at 06:34:48PM +0200, John Kacur wrote:
> From 73bc7345eebb2244efc527928fdac7b8e29193cd Mon Sep 17 00:00:00 2001
> From: John Kacur <jkacur@redhat.com>
> Date: Wed, 21 Oct 2015 18:25:37 +0200
> Subject: [PATCH] cyclictest: fix #ifdef broken by NO_PTHREAD_SETAFFINITY
> 
> Unfortunately c869f3cdcd023eec2f767eb4094caa88178717a4 wasn't sufficient
> to fix #ifdef #else functionality for uclib, broken by the changes for
> bionic.

Yeah, you're right. The wonders of #ifdefs

> In practice this probably didn't break anyone though, except possibly
> for the new bionic code which probaly doesn't have too many adapters
> (yet).
> 
> This should also help Henrik move the NO_PTHREAD_SETAFFINITY functionality to
> the bionic file.

I'm ripping all of the NO_PTHREAD_SETAFFINITY out of cyclictest, so if you 
don't mind, hold off pushing this to the repo -I'm cleaning up my mess.

> Signed-off-by: John Kacur <jkacur@redhat.com>
> ---
>  src/cyclictest/cyclictest.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
> index 00168e22fc7f..975e7858fb8e 100644
> --- a/src/cyclictest/cyclictest.c
> +++ b/src/cyclictest/cyclictest.c
> @@ -83,6 +83,10 @@ int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
>  #define CPU_SET(cpu, cpusetp)
>  #define CPU_ZERO(cpusetp)
>  
> +#else
> +extern int clock_nanosleep(clockid_t __clock_id, int __flags,
> +			   __const struct timespec *__req,
> +			   struct timespec *__rem);
>  #endif
>  
>  #ifdef NO_PTHREAD_SETAFFINITY
> @@ -91,11 +95,6 @@ static inline int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize,
>  {
>      return sched_setaffinity(0, cpusetsize, cpuset);
>  }
> -
> -#else
> -extern int clock_nanosleep(clockid_t __clock_id, int __flags,
> -			   __const struct timespec *__req,
> -			   struct timespec *__rem);
>  #endif
>  
>  #define USEC_PER_SEC		1000000
> -- 
> 2.4.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Henrik Austad

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-21 18:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-21 16:34 [PATCH] cyclictest: fix #ifdef broken by NO_PTHREAD_SETAFFINITY John Kacur
2015-10-21 18:13 ` Henrik Austad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).