aboutsummaryrefslogtreecommitdiff
path: root/toys/nice.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-08-25 14:25:22 -0500
committerRob Landley <rob@landley.net>2012-08-25 14:25:22 -0500
commit3a9241add947cb6d24b5de7a8927517426a78795 (patch)
treed122ab6570439cd6b17c7d73ed8d4e085e0b8a95 /toys/nice.c
parent689f095bc976417bf50810fe59a3b3ac32b21105 (diff)
downloadtoybox-3a9241add947cb6d24b5de7a8927517426a78795.tar.gz
Move commands into "posix", "lsb", and "other" menus/directories.
Diffstat (limited to 'toys/nice.c')
-rw-r--r--toys/nice.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/toys/nice.c b/toys/nice.c
deleted file mode 100644
index 84975dfc..00000000
--- a/toys/nice.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* vi: set sw=4 ts=4:
- *
- * nice.c - Run a program at a different niceness level.
- *
- * Copyright 2010 Rob Landley <rob@landley.net>
- *
- * See http://www.opengroup.org/onlinepubs/9699919799/utilities/nice.html
-
-USE_NICE(NEWTOY(nice, "^<1n#", TOYFLAG_USR|TOYFLAG_BIN))
-
-config NICE
- bool "nice"
- default y
- help
- usage: nice [-n PRIORITY] command [args...]
-
- Run a command line at an increased or decreased scheduling priority.
-
- Higher numbers make a program yield more CPU time, from -20 (highest
- priority) to 19 (lowest). By default processes inherit their parent's
- niceness (usually 0). By default this command adds 10 to the parent's
- priority. Only root can set a negative niceness level.
-*/
-
-#include "toys.h"
-
-DEFINE_GLOBALS(
- long priority;
-)
-
-#define TT this.nice
-
-void nice_main(void)
-{
- if (!toys.optflags) TT.priority = 10;
-
- errno = 0;
- if (nice(TT.priority)==-1 && errno) perror_exit("Can't set priority");
-
- xexec(toys.optargs);
-}