]> granicus.if.org Git - strace/commit
sched: enhance decoding of sched_setattr syscall
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 19 Feb 2017 00:31:40 +0000 (00:31 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 19 Feb 2017 00:31:40 +0000 (00:31 +0000)
commit556652be53452fabcc26a1b0849c1a3d7133d264
tree76c8cc1bc09679a12eb2f898acf5e227f076a8bd
parentf31755fda2015cbb1aa0686e257118169f102031
sched: enhance decoding of sched_setattr syscall

Implement read/write semantics of struct sched_attr.size argument
of sched_setattr syscall.  Do not print members of struct sched_attr
besides sched_attr.size when the specified structure size is less than
the minimal size allowed by the kernel.

* sched.c (print_sched_attr): Fetch struct sched_attr.size and use it
as the structure size.  Print struct sched_attr.size only when the
structure size is less than SCHED_ATTR_MIN_SIZE.
(SYS_FUNC(sched_setattr)): Call print_sched_attr with zero size
argument.  Print struct sched_attr.size returned by the kernel
on exiting syscall in case of E2BIG. Print the last syscall argument
on exiting syscall.
(SYS_FUNC(sched_getattr)): Do not call print_sched_attr with zero size
argument.
* NEWS: Mention it.
* tests/sched_xetattr.c (main): Check it.
NEWS
sched.c
tests/sched_xetattr.c