From: Sascha Wildner Date: Wed, 2 Jun 2010 20:54:21 +0000 (+0200) Subject: Rename ionice(1) to ioprio(1) and add a short manual page. X-Git-Url: https://gitweb.dragonflybsd.org/~lentferj/dragonfly.git/commitdiff_plain/c89a6c1bb6d5d9b5f62f6c3eb9fe279b2bc14043 Rename ionice(1) to ioprio(1) and add a short manual page. --- diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc index e063f275bb..41e13c9916 100644 --- a/Makefile_upgrade.inc +++ b/Makefile_upgrade.inc @@ -1377,3 +1377,4 @@ TO_REMOVE+=/usr/share/man/man4/i386/ndis.4.gz TO_REMOVE+=/usr/sbin/ndiscvt TO_REMOVE+=/usr/share/man/cat8/ndiscvt.8.gz TO_REMOVE+=/usr/share/man/man8/ndiscvt.8.gz +TO_REMOVE+=/usr/bin/ionice diff --git a/lib/libc/sys/ioprio_get.2 b/lib/libc/sys/ioprio_get.2 index 9c60bb7f78..3af78083f5 100644 --- a/lib/libc/sys/ioprio_get.2 +++ b/lib/libc/sys/ioprio_get.2 @@ -125,7 +125,7 @@ specified in .Fa who .El .Sh SEE ALSO -.Xr ionice 1 +.Xr ioprio 1 .Sh HISTORY The .Fn ioprio_get diff --git a/usr.bin/Makefile b/usr.bin/Makefile index cb6064c5b1..bcf04694dd 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -75,7 +75,7 @@ SUBDIR= alias \ iconv \ id \ indent \ - ionice \ + ioprio \ ipcrm \ ipcs \ join \ diff --git a/usr.bin/ionice/Makefile b/usr.bin/ionice/Makefile deleted file mode 100644 index e7b8322d76..0000000000 --- a/usr.bin/ionice/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 6/6/93 -# $DragonFly: src/usr.bin/nice/Makefile,v 1.3 2007/08/27 16:50:57 pavalos Exp $ - -PROG= ionice -NOMAN= - -.include diff --git a/usr.bin/ioprio/Makefile b/usr.bin/ioprio/Makefile new file mode 100644 index 0000000000..ea231b28c1 --- /dev/null +++ b/usr.bin/ioprio/Makefile @@ -0,0 +1,3 @@ +PROG= ioprio + +.include diff --git a/usr.bin/ioprio/ioprio.1 b/usr.bin/ioprio/ioprio.1 new file mode 100644 index 0000000000..9550dd2582 --- /dev/null +++ b/usr.bin/ioprio/ioprio.1 @@ -0,0 +1,58 @@ +.\" +.\" Copyright (c) 2010 +.\" The DragonFly Project. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" 3. Neither the name of The DragonFly Project nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific, prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd June 2, 2010 +.Dt IOPRIO 1 +.Os +.Sh NAME +.Nm ioprio +.Nd execute a utility at an altered I/O scheduling priority +.Sh SYNOPSIS +.Nm +.Op Fl n ar increment +.Ar utility +.Op Ar argument ... +.Sh DESCRIPTION +The +.Nm +utility runs +.Ar utility at an altered I/O scheduling priority, by incrementing its +.Dq ioprio +value by the specified +.Ar increment , +or a default value of 4. +.Sh SEE ALSO +.Xr ioprio_set 2 +.Sh HISTORY +The +.Nm +utility first appeared in +.Dx 2.7 . diff --git a/usr.bin/ionice/ionice.c b/usr.bin/ioprio/ioprio.c similarity index 80% rename from usr.bin/ionice/ionice.c rename to usr.bin/ioprio/ioprio.c index 838ae6da91..ab640aa743 100644 --- a/usr.bin/ionice/ionice.c +++ b/usr.bin/ioprio/ioprio.c @@ -33,7 +33,6 @@ * @(#) Copyright (c) 1989, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)nice.c 8.2 (Berkeley) 4/16/94 * $FreeBSD: src/usr.bin/nice/nice.c,v 1.4.2.1 2002/06/18 08:40:28 tjr Exp $ - * $DragonFly: src/usr.bin/nice/nice.c,v 1.6 2005/10/09 15:09:02 liamfoy Exp $ */ #include @@ -48,31 +47,25 @@ #include #include -#define DEFNICE 4 +#define DEFPRIO 4 static void usage(void); int main(int argc, char **argv) { - long niceness = DEFNICE; + long ioprio = DEFPRIO; int ch; char *ep; - /* Obsolescent syntax: -number, --number */ - if (argc >= 2 && argv[1][0] == '-' && (argv[1][1] == '-' || - isdigit(argv[1][1])) && strcmp(argv[1], "--") != 0) - if (asprintf(&argv[1], "-n%s", argv[1] + 1) < 0) - err(1, "asprintf"); - while ((ch = getopt(argc, argv, "n:")) != -1) { switch (ch) { case 'n': errno = 0; - niceness = strtol(optarg, &ep, 10); + ioprio = strtol(optarg, &ep, 10); if (ep == optarg || *ep != '\0' || errno || - niceness < INT_MIN || niceness > INT_MAX) - errx(1, "%s: invalid ionice value", optarg); + ioprio < INT_MIN || ioprio > INT_MAX) + errx(1, "%s: invalid ioprio value", optarg); break; default: usage(); @@ -85,10 +78,10 @@ main(int argc, char **argv) usage(); errno = 0; - niceness += ioprio_get(PRIO_PROCESS, 0); + ioprio += ioprio_get(PRIO_PROCESS, 0); if (errno) warn("ioprio_get"); - else if (ioprio_set(PRIO_PROCESS, 0, (int)niceness)) + else if (ioprio_set(PRIO_PROCESS, 0, (int)ioprio)) warn("ioprio_set"); execvp(*argv, argv); err(errno == ENOENT || errno == ENOTDIR ? 127 : 126, "%s", *argv); @@ -98,6 +91,6 @@ static void usage(void) { - fprintf(stderr, "usage: ionice [-n incr] utility [arguments]\n"); + fprintf(stderr, "usage: ioprio [-n increment] utility [argument ...]\n"); exit(1); }