]> git.pld-linux.org Git - packages/util-linux.git/blob - util-linux-schedutils-SCHED_BATCH.patch
- removed TODO for raw, raw is obsolete use open(..., O_DIRECT)
[packages/util-linux.git] / util-linux-schedutils-SCHED_BATCH.patch
1 - SCHED_BATCH option missing in chrt
2
3 --- util-linux-2.13-pre6/schedutils/chrt.1.batch        2006-11-10 13:23:37.000000000 -0500
4 +++ util-linux-2.13-pre6/schedutils/chrt.1      2006-11-10 13:27:23.000000000 -0500
5 @@ -36,10 +36,11 @@
6  .BR chrt (1)
7  sets or retrieves the real-time scheduling attributes of an existing PID or
8  runs COMMAND with the given attributes.  Both policy (one of
9 +.BR SCHED_OTHER ,
10  .BR SCHED_FIFO ,
11  .BR SCHED_RR ,
12  or
13 -.BR SCHED_OTHER )
14 +.BR SCHED_BATCH )
15  and priority can be set and retrieved.
16  .SH OPTIONS
17  .TP
18 @@ -48,6 +49,10 @@
19  .TP
20  
21  .TP
22 +.B -b, --batch
23 +set scheduling policy to
24 +.BR SCHED_BATCH
25 +.TP
26  .B -f, --fifo
27  set scheduling policy to
28  .BR SCHED_FIFO
29 --- util-linux-2.13-pre6/schedutils/chrt.c.batch        2005-08-14 11:18:54.000000000 -0400
30 +++ util-linux-2.13-pre6/schedutils/chrt.c      2006-11-10 13:27:52.000000000 -0500
31 @@ -36,6 +36,8 @@
32         fprintf(stderr, "usage: %s [options] [prio] [pid | cmd [args...]]\n",
33                         cmd);
34         fprintf(stderr, "manipulate real-time attributes of a process\n");
35 +       fprintf(stderr, "  -b, --batch                        "
36 +                       "set policy to SCHED_BATCH\n");
37         fprintf(stderr, "  -f, --fifo                         "
38                         "set policy to SCHED_FF\n");
39         fprintf(stderr, "  -p, --pid                          "
40 @@ -83,6 +85,9 @@
41         case SCHED_RR:
42                 printf("SCHED_RR\n");
43                 break;
44 +       case SCHED_BATCH:
45 +               printf("SCHED_BATCH\n");
46 +               break;
47         default:
48                 printf("unknown\n");
49         }
50 @@ -101,6 +106,13 @@
51  {
52         int max, min;
53  
54 +       max = sched_get_priority_max(SCHED_OTHER);
55 +       min = sched_get_priority_min(SCHED_OTHER);
56 +       if (max >= 0 && min >= 0)
57 +               printf("SCHED_OTHER min/max priority\t: %d/%d\n", min, max);
58 +       else
59 +               printf("SCHED_OTHER not supported?\n");
60 +
61         max = sched_get_priority_max(SCHED_FIFO);
62         min = sched_get_priority_min(SCHED_FIFO);
63         if (max >= 0 && min >= 0)
64 @@ -115,12 +127,12 @@
65         else
66                 printf("SCHED_RR not supported?\n");
67  
68 -       max = sched_get_priority_max(SCHED_OTHER);
69 -       min = sched_get_priority_min(SCHED_OTHER);
70 +       max = sched_get_priority_max(SCHED_BATCH);
71 +       min = sched_get_priority_min(SCHED_BATCH);
72         if (max >= 0 && min >= 0)
73 -               printf("SCHED_OTHER min/max priority\t: %d/%d\n", min, max);
74 +               printf("SCHED_BATCH min/max priority\t: %d/%d\n", min, max);
75         else
76 -               printf("SCHED_OTHER not supported?\n");
77 +               printf("SCHED_BATCH not supported?\n");
78  }
79  
80  int main(int argc, char *argv[])
81 @@ -130,6 +142,7 @@
82         pid_t pid = 0;
83  
84         struct option longopts[] = {
85 +               { "batch",      0, NULL, 'b' },
86                 { "fifo",       0, NULL, 'f' },
87                 { "pid",        0, NULL, 'p' },
88                 { "help",       0, NULL, 'h' },
89 @@ -141,11 +154,14 @@
90                 { NULL,         0, NULL, 0 }
91         };
92  
93 -       while((i = getopt_long(argc, argv, "+fphmorvV", longopts, NULL)) != -1)
94 +       while((i = getopt_long(argc, argv, "+bfphmorvV", longopts, NULL)) != -1)
95         {
96                 int ret = 1;
97  
98                 switch (i) {
99 +               case 'b':
100 +                       policy = SCHED_BATCH;
101 +                       break;
102                 case 'f':
103                         policy = SCHED_FIFO;
104                         break;
This page took 0.029752 seconds and 3 git commands to generate.