Re: [PATCH] schedutils: don't assume SCHED_BATCH and SCHED_IDLE exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 27 April 2009 03:07:59 Aurelien Jarno wrote:
> Mike Frysinger a écrit :
> > On Wednesday 22 April 2009 03:18:28 Aurelien Jarno wrote:
> >> On Mon, Apr 20, 2009 at 01:13:28AM -0400, Mike Frysinger wrote:
> >>> On Sunday 19 April 2009 10:34:10 Aurelien Jarno wrote:
> >>>> SCHED_FIFO, SCHED_OTHER, SCHED_RR are part of POSIX 1003.1b Process
> >>>> Scheduling, so it is correct to assume they always exists.
> >>>>
> >>>> SCHED_BATCH and SCHED_IDLE are Linux specific, we should not assume
> >>>> they exists.
> >>>
> >>> looks like you add a whole lot of ifdef's for no real gain.  on
> >>> non-Linux systems, you end up with options that simply dont work.  not
> >>> a big deal. on the flip side, these ifdef's are pretty invasive and
> >>> split up code in a pretty bad way.
> >>
> >> Ok, please find a simpler patch below, we only adds the #ifdef to the
> >> locations where we really need the values of SCHED_BATCH and SCHED_IDLE.
> >
> > i still dont get it.  why do you need these changes at all ?  looks to me
> > like the build should work perfectly fine on any system regardless of
> > SCHED_BATCH or SCHED_IDLE being defined/supported/whatever.
>
> If SCHED_BATCH is not a defined value how the following code would work?
>
>         case SCHED_BATCH:
>                 printf("SCHED_BATCH\n");
>                 break;

this is weird circular logic.  first, you disable the SCHED_BATCH define and 
then wonder how it could possibly work without it being defined ?  face, meet 
palm ...

-#ifndef SCHED_BATCH
+#if defined (__linux__) && !defined(SCHED_BATCH)
 # define SCHED_BATCH 3
 #endif
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux