mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
Linux: Do not check unused bytes after sched_getattr in tst-sched_setattr
Linux 6.13 was released with a change that overwrites those bytes. This means that the check_unused subtest fails. Update the manual accordingly. Tested-by: Xi Ruoyao <xry111@xry111.site> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
89e61e96b7
commit
b3a6bd625c
2 changed files with 3 additions and 14 deletions
|
@ -1058,9 +1058,9 @@ available in the future.
|
||||||
|
|
||||||
Upon success, @code{@var{attr}->size} contains the size of the structure
|
Upon success, @code{@var{attr}->size} contains the size of the structure
|
||||||
version used by the kernel. Fields with offsets greater or equal to
|
version used by the kernel. Fields with offsets greater or equal to
|
||||||
@code{@var{attr}->size} are not updated by the kernel. To obtain
|
@code{@var{attr}->size} may not be overwritten by the kernel. To obtain
|
||||||
predictable values for unknown fields, use @code{memset} to set
|
predictable values for unknown fields, use @code{memset} to set all
|
||||||
all @var{size} bytes to zero prior to calling @code{sched_getattr}.
|
@var{size} bytes to zero prior to calling @code{sched_getattr}.
|
||||||
|
|
||||||
On failure, @code{sched_getattr} returns @math{-1} and sets @code{errno}.
|
On failure, @code{sched_getattr} returns @math{-1} and sets @code{errno}.
|
||||||
If @code{errno} is @code{E2BIG}, this means that the buffer is not large
|
If @code{errno} is @code{E2BIG}, this means that the buffer is not large
|
||||||
|
|
|
@ -33,14 +33,6 @@ union
|
||||||
unsigned char padding[4096];
|
unsigned char padding[4096];
|
||||||
} u;
|
} u;
|
||||||
|
|
||||||
static void
|
|
||||||
check_unused (void)
|
|
||||||
{
|
|
||||||
TEST_VERIFY (u.attr.size < sizeof (u));
|
|
||||||
for (unsigned int i = u.attr.size; i < sizeof (u); ++i)
|
|
||||||
TEST_COMPARE (u.padding[i], 0xcc);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
do_test (void)
|
do_test (void)
|
||||||
{
|
{
|
||||||
|
@ -53,7 +45,6 @@ do_test (void)
|
||||||
/* Compiler barrier to bypass write access attribute. */
|
/* Compiler barrier to bypass write access attribute. */
|
||||||
volatile unsigned int size = sizeof (u);
|
volatile unsigned int size = sizeof (u);
|
||||||
TEST_COMPARE (sched_getattr (0, (struct sched_attr *) &u, size, 0), 0);
|
TEST_COMPARE (sched_getattr (0, (struct sched_attr *) &u, size, 0), 0);
|
||||||
check_unused ();
|
|
||||||
TEST_COMPARE (sched_setattr (0, &u.attr, 0), 0); /* Apply unchanged. */
|
TEST_COMPARE (sched_setattr (0, &u.attr, 0), 0); /* Apply unchanged. */
|
||||||
|
|
||||||
/* Try to switch to the SCHED_OTHER policy. */
|
/* Try to switch to the SCHED_OTHER policy. */
|
||||||
|
@ -81,14 +72,12 @@ do_test (void)
|
||||||
memset (&u, 0xcc, sizeof (u));
|
memset (&u, 0xcc, sizeof (u));
|
||||||
TEST_COMPARE (sched_getattr (0, (struct sched_attr *) &u, size, 0), 0);
|
TEST_COMPARE (sched_getattr (0, (struct sched_attr *) &u, size, 0), 0);
|
||||||
TEST_COMPARE (u.attr.sched_policy, SCHED_OTHER);
|
TEST_COMPARE (u.attr.sched_policy, SCHED_OTHER);
|
||||||
check_unused ();
|
|
||||||
|
|
||||||
/* Raise the niceless level to 19 and observe its effect. */
|
/* Raise the niceless level to 19 and observe its effect. */
|
||||||
TEST_COMPARE (nice (19), 19);
|
TEST_COMPARE (nice (19), 19);
|
||||||
TEST_COMPARE (sched_getattr (0, &u.attr, sizeof (u.attr), 0), 0);
|
TEST_COMPARE (sched_getattr (0, &u.attr, sizeof (u.attr), 0), 0);
|
||||||
TEST_COMPARE (u.attr.sched_policy, SCHED_OTHER);
|
TEST_COMPARE (u.attr.sched_policy, SCHED_OTHER);
|
||||||
TEST_COMPARE (u.attr.sched_nice, 19);
|
TEST_COMPARE (u.attr.sched_nice, 19);
|
||||||
check_unused ();
|
|
||||||
|
|
||||||
/* Invalid buffer arguments result in EINVAL (not EFAULT). */
|
/* Invalid buffer arguments result in EINVAL (not EFAULT). */
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue