diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | bits/sched.h | 19 | ||||
-rw-r--r-- | sysdeps/generic/bits/sched.h | 19 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/sched.h | 19 |
4 files changed, 39 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog index a695b28374..caa9523030 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-05-10 Ulrich Drepper <drepper@redhat.com> + + * sysdeps/generic/bits/sched.h: Define cpu_set_t only if not + already defined and when really needed. + * sysdeps/unix/sysv/linux/bits/sched.h: Likewise. + 2003-05-09 Thorsten Kukuk <kukuk@suse.de> * sysdeps/unix/sysv/linux/netinet/igmp.h: Don't include kernel diff --git a/bits/sched.h b/bits/sched.h index fc754bff51..91b6dca0ca 100644 --- a/bits/sched.h +++ b/bits/sched.h @@ -35,16 +35,18 @@ struct sched_param }; +#if defined _SCHED_H && !defined __cpu_set_t_defined +# define __cpu_set_t_defined /* Size definition for CPU sets. */ -#define __CPU_SETSIZE 1024 -#define __NCPUBITS (8 * sizeof (__cpu_mask)) +# define __CPU_SETSIZE 1024 +# define __NCPUBITS (8 * sizeof (__cpu_mask)) /* Type for array elements in 'cpu_set'. */ typedef unsigned long int __cpu_mask; /* Basic access functions. */ -#define __CPUELT(cpu) ((cpu) / __NCPUBITS) -#define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) +# define __CPUELT(cpu) ((cpu) / __NCPUBITS) +# define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) /* Data structure to describe CPU mask. */ typedef struct @@ -53,16 +55,17 @@ typedef struct } cpu_set_t; /* Access functions for CPU masks. */ -#define __CPU_ZERO(cpusetp) \ +# define __CPU_ZERO(cpusetp) \ do { \ unsigned int __i; \ cpu_set *__arr = (cpusetp); \ for (__i = 0; __i < sizeof (cpu_set) / sizeof (__cpu_mask); ++__i) \ __arr->__bits[__i] = 0; \ } while (0) -#define __CPU_SET(cpu, cpusetp) \ +# define __CPU_SET(cpu, cpusetp) \ ((cpusetp)->__bits[__CPUELT (cpu)] |= __CPUMASK (cpu)) -#define __CPU_CLR(cpu, cpusetp) \ +# define __CPU_CLR(cpu, cpusetp) \ ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu)) -#define __CPU_ISSET(cpu, cpusetp) \ +# define __CPU_ISSET(cpu, cpusetp) \ (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0) +#endif diff --git a/sysdeps/generic/bits/sched.h b/sysdeps/generic/bits/sched.h index fc754bff51..91b6dca0ca 100644 --- a/sysdeps/generic/bits/sched.h +++ b/sysdeps/generic/bits/sched.h @@ -35,16 +35,18 @@ struct sched_param }; +#if defined _SCHED_H && !defined __cpu_set_t_defined +# define __cpu_set_t_defined /* Size definition for CPU sets. */ -#define __CPU_SETSIZE 1024 -#define __NCPUBITS (8 * sizeof (__cpu_mask)) +# define __CPU_SETSIZE 1024 +# define __NCPUBITS (8 * sizeof (__cpu_mask)) /* Type for array elements in 'cpu_set'. */ typedef unsigned long int __cpu_mask; /* Basic access functions. */ -#define __CPUELT(cpu) ((cpu) / __NCPUBITS) -#define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) +# define __CPUELT(cpu) ((cpu) / __NCPUBITS) +# define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) /* Data structure to describe CPU mask. */ typedef struct @@ -53,16 +55,17 @@ typedef struct } cpu_set_t; /* Access functions for CPU masks. */ -#define __CPU_ZERO(cpusetp) \ +# define __CPU_ZERO(cpusetp) \ do { \ unsigned int __i; \ cpu_set *__arr = (cpusetp); \ for (__i = 0; __i < sizeof (cpu_set) / sizeof (__cpu_mask); ++__i) \ __arr->__bits[__i] = 0; \ } while (0) -#define __CPU_SET(cpu, cpusetp) \ +# define __CPU_SET(cpu, cpusetp) \ ((cpusetp)->__bits[__CPUELT (cpu)] |= __CPUMASK (cpu)) -#define __CPU_CLR(cpu, cpusetp) \ +# define __CPU_CLR(cpu, cpusetp) \ ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu)) -#define __CPU_ISSET(cpu, cpusetp) \ +# define __CPU_ISSET(cpu, cpusetp) \ (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0) +#endif diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h index 63ae0e40f6..43e87c48bc 100644 --- a/sysdeps/unix/sysv/linux/bits/sched.h +++ b/sysdeps/unix/sysv/linux/bits/sched.h @@ -88,16 +88,18 @@ struct __sched_param #endif +#if defined _SCHED_H && !defined __cpu_set_t_defined +# define __cpu_set_t_defined /* Size definition for CPU sets. */ -#define __CPU_SETSIZE 1024 -#define __NCPUBITS (8 * sizeof (__cpu_mask)) +# define __CPU_SETSIZE 1024 +# define __NCPUBITS (8 * sizeof (__cpu_mask)) /* Type for array elements in 'cpu_set'. */ typedef unsigned long int __cpu_mask; /* Basic access functions. */ -#define __CPUELT(cpu) ((cpu) / __NCPUBITS) -#define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) +# define __CPUELT(cpu) ((cpu) / __NCPUBITS) +# define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) /* Data structure to describe CPU mask. */ typedef struct @@ -106,16 +108,17 @@ typedef struct } cpu_set_t; /* Access functions for CPU masks. */ -#define __CPU_ZERO(cpusetp) \ +# define __CPU_ZERO(cpusetp) \ do { \ unsigned int __i; \ cpu_set *__arr = (cpusetp); \ for (__i = 0; __i < sizeof (cpu_set) / sizeof (__cpu_mask); ++__i) \ __arr->__bits[__i] = 0; \ } while (0) -#define __CPU_SET(cpu, cpusetp) \ +# define __CPU_SET(cpu, cpusetp) \ ((cpusetp)->__bits[__CPUELT (cpu)] |= __CPUMASK (cpu)) -#define __CPU_CLR(cpu, cpusetp) \ +# define __CPU_CLR(cpu, cpusetp) \ ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu)) -#define __CPU_ISSET(cpu, cpusetp) \ +# define __CPU_ISSET(cpu, cpusetp) \ (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0) +#endif |