Skip to content

Commit 1a1baac

Browse files
authored
Merge pull request #2 from sunhaiyong1978/fix-syscall
fix build error for glibc >= 2.41
2 parents f036509 + 252ddd7 commit 1a1baac

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

linux-user/syscall.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned int, len,
358358
#define __NR_sys_sched_setaffinity __NR_sched_setaffinity
359359
_syscall3(int, sys_sched_setaffinity, pid_t, pid, unsigned int, len,
360360
unsigned long *, user_mask_ptr);
361-
/* sched_attr is not defined in glibc */
361+
/* sched_attr is not defined in glibc < 2.41 */
362+
#ifndef SCHED_ATTR_SIZE_VER0
362363
struct sched_attr {
363364
uint32_t size;
364365
uint32_t sched_policy;
@@ -371,6 +372,7 @@ struct sched_attr {
371372
uint32_t sched_util_min;
372373
uint32_t sched_util_max;
373374
};
375+
#endif
374376
#define __NR_sys_sched_getattr __NR_sched_getattr
375377
_syscall4(int, sys_sched_getattr, pid_t, pid, struct sched_attr *, attr,
376378
unsigned int, size, unsigned int, flags);

0 commit comments

Comments
 (0)