aboutsummaryrefslogtreecommitdiff
path: root/toys/pending
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-07-31 16:36:57 -0500
committerRob Landley <rob@landley.net>2013-07-31 16:36:57 -0500
commit9c8047a9395e1ca043a0b76d666b66fe4db410b3 (patch)
tree10f2d5b024beb15d3f0702d7b01d081f32e94895 /toys/pending
parent9e89d47a29dbcc353004c968c0b5da05ff89c653 (diff)
downloadtoybox-9c8047a9395e1ca043a0b76d666b66fe4db410b3.tar.gz
Move renice from pending to posix, default y, fix link to standard.
Diffstat (limited to 'toys/pending')
-rw-r--r--toys/pending/renice.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/toys/pending/renice.c b/toys/pending/renice.c
deleted file mode 100644
index 6d0bdac1..00000000
--- a/toys/pending/renice.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* renice.c - renice process
- *
- * Copyright 2013 CE Strake <strake888 at gmail.com>
- *
- * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/
- * See http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/cmdbehav.html
-
-USE_RENICE(NEWTOY(renice, "<1gpun#|", TOYFLAG_BIN))
-
-config RENICE
- bool "renice"
- default n
- help
- usage: renice [-gpu] -n increment ID ...
-*/
-
-#define FOR_renice
-#include "toys.h"
-
-GLOBALS(
- long nArgu;
-)
-
-void renice_main(void) {
- int which = (toys.optflags & FLAG_g) ? PRIO_PGRP :
- ((toys.optflags & FLAG_u) ? PRIO_USER : PRIO_PROCESS);
- char **arg;
-
- for (arg = toys.optargs; *arg; arg++) {
- char *s = *arg;
- int id = -1;
-
- if (toys.optflags & FLAG_u) {
- struct passwd *p = getpwnam(s);
- if (p) id = p->pw_uid;
- } else {
- id = strtol(s, &s, 10);
- if (*s) id = -1;
- }
-
- if (id < 0) {
- error_msg("bad '%s'", *arg);
- continue;
- }
-
- if (setpriority(which, id, getpriority(which, id)+TT.nArgu) < 0)
- perror_msg("setpriority %d", id);
- }
-}