* [PATCH] Fix __sched_cpucount
@ 2007-07-17 18:55 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2007-07-17 18:55 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Glibc hackers
Hi!
This patch makes CPU_COUNT macro working even in C++ and as an added bonus
fixes also bits/sched.h which got out of sync with linux version of this
header during last change.
2007-07-17 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/bits/sched.h (__sched_cpucount): Add
__BEGIN_DECLS/__END_DECLS around the prototype.
* bits/sched.h (__sched_cpucount): Likewise. Make second argument
pointer to const cpu_set_t.
--- libc/sysdeps/unix/sysv/linux/bits/sched.h.jj 2007-06-12 14:08:19.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/bits/sched.h 2007-07-17 20:45:00.000000000 +0200
@@ -131,8 +131,14 @@ typedef struct
((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu))
# define __CPU_ISSET(cpu, cpusetp) \
(((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
+
+__BEGIN_DECLS
+
extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
__THROW;
+
+__END_DECLS
+
# define __CPU_COUNT(cpusetp) \
__sched_cpucount (sizeof (cpu_set_t), cpusetp)
#endif
--- libc/bits/sched.h.jj 2007-04-23 10:54:00.000000000 +0200
+++ libc/bits/sched.h 2007-07-17 20:46:06.000000000 +0200
@@ -68,7 +68,14 @@ typedef struct
((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu))
# define __CPU_ISSET(cpu, cpusetp) \
(((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
-extern int __sched_cpucount (size_t __setsize, cpu_set_t *__setp) __THROW;
+
+__BEGIN_DECLS
+
+extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
+ __THROW;
+
+__END_DECLS
+
# define __CPU_COUNT(cpusetp) \
__sched_cpucount (sizeof (cpu_set_t), cpusetp)
#endif
Jakub
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-07-17 18:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-17 18:55 [PATCH] Fix __sched_cpucount Jakub Jelinek
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 read-only IMAP folder(s) and NNTP newsgroup(s).