- Posts: 8
- Thank you received: 0
on Debian 13 to build version 6.1.5-1 from source code via pwre.
1 day 10 hours ago #335
by Wei
Hi, Claes
build version 6.1.5-1 from source code via pwre.
running pwre build_all_modules, got error:
rt_thread.c:75:8: error: redefinition of ‘struct sched_attr’
75 | struct sched_attr {
| ^~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sched.h:63,
from /usr/include/sched.h:43,
from /usr/include/pthread.h:22,
from rt_qcom.h:49,
from rt_errh.h:40,
from rt_thread.c:47:
/usr/include/linux/sched/types.h:98:8: note: originally defined here
what did I do wrong?
build version 6.1.5-1 from source code via pwre.
running pwre build_all_modules, got error:
rt_thread.c:75:8: error: redefinition of ‘struct sched_attr’
75 | struct sched_attr {
| ^~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sched.h:63,
from /usr/include/sched.h:43,
from /usr/include/pthread.h:22,
from rt_qcom.h:49,
from rt_errh.h:40,
from rt_thread.c:47:
/usr/include/linux/sched/types.h:98:8: note: originally defined here
what did I do wrong?
Please Log in or Create an account to join the conversation.
1 day 3 hours ago #336
by claes
Replied by claes on topic on Debian 13 to build version 6.1.5-1 from source code via pwre.
Hi Wei,
glibc has been modified in Debian 13 and now defines struct sched_attr. Edit src/lib/rt/src/rt_thread.c and add the #if and #endif statements.
#if __GLIBC__ * 100 + __GLIBC_MINOR__ < 241
struct sched_attr {
uint32_t size;
uint32_t sched_policy;
uint64_t sched_flags;
/* SCHED_NORMAL, SCHED_BATCH */
int32_t sched_nice;
/* SCHED_FIFO, SCHED_RR */
uint32_t sched_priority;
/* SCHED_DEADLINE (nsec) */
uint64_t sched_runtime;
uint64_t sched_deadline;
uint64_t sched_period;
/* Utilization hints */
uint32_t sched_util_min;
uint32_t sched_util_max;
};
int sched_setattr(pid_t pid, const struct sched_attr* attr, unsigned int flags)
{
return syscall(__NR_sched_setattr, pid, attr, flags);
}
int sched_getattr(
pid_t pid, struct sched_attr* attr, unsigned int size, unsigned int flags)
{
return syscall(__NR_sched_getattr, pid, attr, size, flags);
}
#endif
/Claes
glibc has been modified in Debian 13 and now defines struct sched_attr. Edit src/lib/rt/src/rt_thread.c and add the #if and #endif statements.
#if __GLIBC__ * 100 + __GLIBC_MINOR__ < 241
struct sched_attr {
uint32_t size;
uint32_t sched_policy;
uint64_t sched_flags;
/* SCHED_NORMAL, SCHED_BATCH */
int32_t sched_nice;
/* SCHED_FIFO, SCHED_RR */
uint32_t sched_priority;
/* SCHED_DEADLINE (nsec) */
uint64_t sched_runtime;
uint64_t sched_deadline;
uint64_t sched_period;
/* Utilization hints */
uint32_t sched_util_min;
uint32_t sched_util_max;
};
int sched_setattr(pid_t pid, const struct sched_attr* attr, unsigned int flags)
{
return syscall(__NR_sched_setattr, pid, attr, flags);
}
int sched_getattr(
pid_t pid, struct sched_attr* attr, unsigned int size, unsigned int flags)
{
return syscall(__NR_sched_getattr, pid, attr, size, flags);
}
#endif
/Claes
Please Log in or Create an account to join the conversation.
Time to create page: 0.526 seconds