Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jan 2011 13:08:37 -0800
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        Alexander Best <arundel@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov <kib@freebsd.org>
Subject:   Re: svn commit: r216955 - head/usr.sbin/rtprio
Message-ID:  <AANLkTimDTq-JXF4gm9KUfo5eJaEXKaRF-CYiycFwdZML@mail.gmail.com>
In-Reply-To: <20110106204157.GA41314@freebsd.org>
References:  <201101041413.p04EDA4f038360@svn.freebsd.org> <20110106204157.GA41314@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 6, 2011 at 12:41 PM, Alexander Best <arundel@freebsd.org> wrote=
:

...

> this causes problems when pid is -0:
>
> [id|rt]prio -t -0 and [id|rt]prio 10 -0 will try to run "0" via execvp().
> beforehand however this will also trigger rtprio().
>
> a better solution would be to do:
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (argv[2][0] =3D=3D '-') {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0proc =3D parseint(argv[2] =
+ 1, "pid");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (rtprio(RTP_SET, proc, =
&rtp) !=3D 0)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0err(1, "RT=
P_SET");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0execvp(argv[2], &argv[2]);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0err(1, "%s=
", argv[2]);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}

How did you get a pid of -0?
Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimDTq-JXF4gm9KUfo5eJaEXKaRF-CYiycFwdZML>