xlat: update the list of SCHED_FLAG_* constants
authorEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 15 Feb 2018 18:41:28 +0000 (19:41 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 27 Feb 2018 13:14:38 +0000 (13:14 +0000)
* xlat/sched_flags.in (SCHED_FLAG_RECLAIM, SCHED_FLAG_DL_OVERRUN): New
constants introduced by linux kernel commits v4.13-rc1~205^2~27 and
v4.16-rc1~164^2~8, respectively.
(SCHED_FLAG_RESET_ON_FORK): Add constant value.
* tests/sched_xetattr.c: Update expected output.
* NEWS: Mention it.

NEWS
tests/sched_xetattr.c
xlat/sched_flags.in

diff --git a/NEWS b/NEWS
index 819c91f1b8eee3ed66a535f3f07a0304604a374b..6123ca08b4f9906662e40e13e9a6d76ed5439141 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Noteworthy changes in release ?.?? (????-??-??)
     in brackets.
   * Enhanced NETLINK_ROUTE protocol decoding.
   * Updated lists of signal codes.
-  * Updated lists of POLL* and RWF_* constants.
+  * Updated lists of POLL*, RWF_*, and SCHED_FLAG_* constants.
 
 * Bug fixes
   * Fixed build on m68k.
index a9bd2baa699a6447aa7dcc90a0f9b232b952eb8d..af4a6c50be7e1d3da321365c3060724cd8cbfaf0 100644 (file)
@@ -202,7 +202,7 @@ main(void)
 
        attr->size = 0x90807060;
        attr->sched_policy = 0xca7faced;
-       attr->sched_flags = 0xbadc0ded1057da7aULL;
+       attr->sched_flags = 0xbadc0ded1057da78ULL;
        attr->sched_nice = 0xafbfcfdf;
        attr->sched_priority = 0xb8c8d8e8;
        attr->sched_runtime = 0xbadcaffedeadf157ULL;
@@ -239,6 +239,46 @@ main(void)
                       (unsigned long long) ill, errstr);
        }
 
+
+       attr->size = 0x90807060;
+       attr->sched_policy = 0xca7faced;
+       attr->sched_flags = 0xfULL;
+       attr->sched_nice = 0xafbfcfdf;
+       attr->sched_priority = 0xb8c8d8e8;
+       attr->sched_runtime = 0xbadcaffedeadf157ULL;
+       attr->sched_deadline = 0xc0de70a57badac75ULL;
+       attr->sched_period = 0xded1ca7edda7aca7ULL;
+
+       sys_sched_setattr(bogus_pid, (unsigned long) attr, bogus_flags);
+       printf("sched_setattr(%d, {size=%u, sched_policy=%#x /* SCHED_??? */, "
+              "sched_flags=SCHED_FLAG_RESET_ON_FORK|SCHED_FLAG_RECLAIM|"
+              "SCHED_FLAG_DL_OVERRUN|0x8, "
+              "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", "
+              "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 ", ...}, %u)"
+              " = %s\n",
+              (int) bogus_pid,
+              attr->size,
+              attr->sched_policy,
+              attr->sched_nice,
+              attr->sched_priority,
+              attr->sched_runtime,
+              attr->sched_deadline,
+              attr->sched_period,
+              (unsigned) bogus_flags, errstr);
+
+       if (F8ILL_KULONG_SUPPORTED) {
+               const kernel_ulong_t ill = f8ill_ptr_to_kulong(attr);
+
+               sys_sched_getattr(0, ill, sizeof(*attr), 0);
+               printf("sched_getattr(0, %#llx, %u, 0) = %s\n",
+                      (unsigned long long) ill, (unsigned) sizeof(*attr),
+                      errstr);
+
+               sys_sched_setattr(0, ill, 0);
+               printf("sched_setattr(0, %#llx, 0) = %s\n",
+                      (unsigned long long) ill, errstr);
+       }
+
        puts("+++ exited with 0 +++");
        return 0;
 }
index 824d91dce2e7599b92ecfefbe5ed4cdc21711dfa..10c9066129675a216cf56e769281da085d264182 100644 (file)
@@ -1 +1,3 @@
-SCHED_FLAG_RESET_ON_FORK 1
+SCHED_FLAG_RESET_ON_FORK       1
+SCHED_FLAG_RECLAIM             2
+SCHED_FLAG_DL_OVERRUN          4