diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 1996-11-05 20:18:00 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1996-11-05 20:18:00 +0000 |
| commit | 5bc589fc3fdded97dee339acf570eabe08ffa5ab (patch) | |
| tree | 17251dbb7c6346c8d753a92a5182e13547cbc67c /usr.bin/nice | |
| parent | a1ec9373e14dc9f3a3588c6224061dd90b9c59d0 (diff) | |
Notes
Diffstat (limited to 'usr.bin/nice')
| -rw-r--r-- | usr.bin/nice/nice.1 | 43 | ||||
| -rw-r--r-- | usr.bin/nice/nice.c | 6 |
2 files changed, 35 insertions, 14 deletions
diff --git a/usr.bin/nice/nice.1 b/usr.bin/nice/nice.1 index 67b847100519..db523b339b67 100644 --- a/usr.bin/nice/nice.1 +++ b/usr.bin/nice/nice.1 @@ -1,7 +1,6 @@ .\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" -.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -31,6 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)nice.1 8.1 (Berkeley) 6/6/93 +.\" $Id: nice.1,v 1.2 1996/11/02 22:02:32 wosch Exp $ .\" .Dd June 6, 1993 .Dt NICE 1 @@ -51,25 +51,46 @@ at a low priority. (Think of low and slow). If .Fl Ns Ar number -is specified, and if it is greater than or equal -to 10 (the default), -.Nm nice +is not given +.Nm +assumed the value 10. +The priority is a value in the range -20 to 20. The default priority +is 0, priority 20 is the lowest possible. +.Nm Nice will execute .Ar command -at that priority. -The upper bound, or lowest priority that -.Nm nice -will run a command is 20. -The lower bounds or -higher priorities (integers less than 10) -can only be requested by the super-user. +at priority +.Ar number +relative to the priority +of +.Nm nice . +Higher priorities than the +current process priority can only requested by the +super-user. Negative numbers are expressed as .Fl - Ns Ar number . .Pp The returned exit status is the exit value from the command executed by .Nm nice . +.Sh EXAMPLES +.Pp +$ nice -5 date +.Pp +Execute command +.Sq date +at priority 5 assuming the priority of the +shell is 0. +.Pp +# nice -16 nice --35 date +.Pp +Execute command +.Sq date +at priority -19 assuming the priority of the +shell is 0 and you are the super-user. .Sh SEE ALSO +.Xr getpriority 2 , +.Xr setpriority 2 , .Xr csh 1 , .Xr renice 8 .Sh HISTORY diff --git a/usr.bin/nice/nice.c b/usr.bin/nice/nice.c index b34a9416a1af..300dc873d895 100644 --- a/usr.bin/nice/nice.c +++ b/usr.bin/nice/nice.c @@ -65,7 +65,8 @@ main(argc, argv) int niceness = DEFNICE; if (argc < 2) - errx(1, "usage: nice [-number] command [arguments]"); + usage(); + if (argv[1][0] == '-') if (argv[1][1] == '-' || isdigit(argv[1][1])) { niceness = atoi(argv[1] + 1); @@ -89,7 +90,6 @@ main(argc, argv) void usage() { - (void)fprintf(stderr, - "nice [ -# ] command [ options ] [ operands ]\n"); + (void)fprintf(stderr, "usage: nice [-number] command [arguments]\n"); exit(1); } |
