resource.c \
rtc.c \
sched.c \
+ sched_attr.h \
scsi.c \
seccomp.c \
seccomp_fprog.h \
#include "defs.h"
#include <sched.h>
+#include "sched_attr.h"
#include "xlat/schedulers.h"
#include "xlat/sched_flags.h"
print_sched_attr(struct tcb *const tcp, const kernel_ulong_t addr,
unsigned int size)
{
- struct {
- uint32_t size;
- uint32_t sched_policy;
- uint64_t sched_flags;
- uint32_t sched_nice;
- uint32_t sched_priority;
- uint64_t sched_runtime;
- uint64_t sched_deadline;
- uint64_t sched_period;
- } attr = {};
+ struct sched_attr attr = {};
if (size > sizeof(attr))
size = sizeof(attr);
--- /dev/null
+#ifndef STRACE_SCHED_ATTR_H
+#define STRACE_SCHED_ATTR_H
+
+# include <stdint.h>
+
+struct sched_attr {
+ uint32_t size;
+ uint32_t sched_policy;
+ uint64_t sched_flags;
+ uint32_t sched_nice;
+ uint32_t sched_priority;
+ uint64_t sched_runtime;
+ uint64_t sched_deadline;
+ uint64_t sched_period;
+};
+
+# define SCHED_ATTR_MIN_SIZE 48
+
+#endif /* !STRACE_SCHED_ATTR_H */
# include <stdio.h>
# include <sched.h>
# include <unistd.h>
+# include "sched_attr.h"
# include "xlat.h"
# include "xlat/schedulers.h"
static const kernel_ulong_t bogus_flags =
(kernel_ulong_t) 0xdefaceddeadc0deULL;
- struct {
- uint32_t size;
- uint32_t sched_policy;
- uint64_t sched_flags;
- int32_t sched_nice;
- uint32_t sched_priority;
- uint64_t sched_runtime;
- uint64_t sched_deadline;
- uint64_t sched_period;
- } *const attr = tail_alloc(sizeof(*attr));
+ struct sched_attr *const attr = tail_alloc(sizeof(*attr));
void *const efault = attr + 1;
sys_sched_getattr(bogus_pid, 0, 0, 0);