Hi,

Colin Watson schrieb am Wed 07. Jan, 12:18 (+0000):
> On Sat, Sep 22, 2007 at 09:35:25AM +0200, Dominique Dumont wrote:
> > I use start-stop-daemon to launch hellanzb which can sometimes be very
> > io intensive (with par2 and unrar)
> > 
> > It would be great if I could launch hellanzb with ionice -c idle
> > through start-stop-daemon. Could you add an option --ioniceclass or
> > --ionicelevel ?
> 
> Chris Coulson <[email protected]> sent a patch for this to
> the corresponding Ubuntu bug report
> (https://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/306961).

> diff -Nru dpkg-1.14.22ubuntu1/utils/start-stop-daemon.c 
> dpkg-1.14.22ubuntu2/utils/start-stop-daemon.c
> --- dpkg-1.14.22ubuntu1/utils/start-stop-daemon.c     2008-08-26 
> 14:52:08.000000000 +0100
> +++ dpkg-1.14.22ubuntu2/utils/start-stop-daemon.c     2008-12-10 
> 20:36:51.000000000 +0000
> @@ -1221,6 +1236,12 @@
>       }
>  }
>  
> +static inline int
> +ioprio_set (int which, int who, int ioprio)
> +{
> +     return syscall(SYS_ioprio_set, which, who, ioprio);

Why don't you use ioprio_set() from the libc? Wouldn't be this much more
safe for the future?

> @@ -1334,6 +1355,12 @@
>                       fatal("Unable to alter nice level by %i: %s",
>                             nicelevel, strerror(errno));
>       }
> +     if (ioprio) {
> +             errno = 0;
> +             if ((ioprio_set(IOPRIO_WHO_PROCESS, getpid(), ioprio << 13) == 
> -1) && (errno != 0))

To me, the macro IOPRIO_PRIO_DATA would be more readable than << 13.
And I miss the possibility to select a different scheduler class.

Bye, Jörg.
-- 
“Unfortunately, the current generation of mail programs do not have
 checkers to see if the sender knows what he is talking about”
            (Andrew S. Tanenbaum)

Attachment: signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP

Reply via email to