]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Use the phrase "niceness" instead of "nice value" to describe
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 8 Sep 2005 06:52:09 +0000 (06:52 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 8 Sep 2005 06:52:09 +0000 (06:52 +0000)
the biased nice value that can go negative.  This corrects
a discrepancy with POSIX, which states that nice values are
nonnegative.

ChangeLog
doc/ChangeLog
doc/coreutils.texi
src/nice.c

index bd314138f44784a4dedbd8eaf1d97305cc0b0702..da6280e7a627c5c733e064c741d5f343532d9b23 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,19 @@
-2005-09-07  Jim Meyering  <jim@meyering.net>
+2005-09-07  Paul Eggert  <eggert@cs.ucla.edu>
 
        * Version 5.3.1-cvs.
 
+       Use the phrase "niceness" instead of "nice value" to describe
+       the biased nice value that can go negative.  This corrects
+       a discrepancy with POSIX, which states that nice values are
+       nonnegative.
+       * src/nice.c (GET_NICENESS): Renamed from GET_NICE_VALUE.
+       All uses changed.
+       (usage): Say "niceness" rather than "nice value".
+       (main): Say "niceness" rather than "priority" (which is something else
+       entirely nowadays).
+
+2005-09-07  Jim Meyering  <jim@meyering.net>
+
        * src/du.c (time_args): Use NULL in place of 0.
 
 2005-09-05  Jim Meyering  <jim@meyering.net>
index ced07f6682a69d93e63a87559a3a2f43382990c2..f81dde6c5980073d9f28e567510ae51d03c1ce25 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * coreutils.texi (nice invocation): Use "niceness", not "nice value"
+       to talk about nice values offset by -20.  Don't use the word
+       "priority" when niceness is intended.
+
 2005-08-15  Jim Meyering  <jim@meyering.net>
 
        * coreutils.texi (join invocation): Itemize the defaults.
index 69dde00192534ad24f07a8359355c2d315be13eb..32b6977a6deb79247e94bf22a5163c3b6aee43ea 100644 (file)
@@ -79,7 +79,7 @@
 * mkfifo: (coreutils)mkfifo invocation.         Create FIFOs (named pipes).
 * mknod: (coreutils)mknod invocation.           Create special files.
 * mv: (coreutils)mv invocation.                 Rename files.
-* nice: (coreutils)nice invocation.             Modify scheduling priority.
+* nice: (coreutils)nice invocation.             Modify niceness.
 * nl: (coreutils)nl invocation.                 Number lines and write files.
 * nohup: (coreutils)nohup invocation.           Immunize to hangups.
 * od: (coreutils)od invocation.                 Dump files in octal, etc.
@@ -407,7 +407,7 @@ Modified command invocation
 
 * chroot invocation::            Run a command with a different root directory
 * env invocation::               Run a command in a modified environment
-* nice invocation::              Run a command with modified scheduling priority
+* nice invocation::              Run a command with modified niceness
 * nohup invocation::             Run a command immune to hangups
 * su invocation::                Run a command with substitute user and group ID
 
@@ -12339,7 +12339,7 @@ user, etc.
 @menu
 * chroot invocation::           Modify the root directory.
 * env invocation::              Modify environment variables.
-* nice invocation::             Modify scheduling priority.
+* nice invocation::             Modify niceness.
 * nohup invocation::            Immunize to hangups.
 * su invocation::               Modify user and group ID.
 @end menu
@@ -12491,32 +12491,29 @@ the exit status of @var{command} otherwise
 
 
 @node nice invocation
-@section @command{nice}: Run a command with modified scheduling priority
+@section @command{nice}: Run a command with modified niceness
 
 @pindex nice
-@cindex nice value
-@cindex modifying scheduling priority
-@cindex scheduling priority, modifying
-@cindex priority, modifying
+@cindex niceness
+@cindex scheduling, affecting
 @cindex appropriate privileges
 
-@command{nice} prints or modifies a process's @dfn{nice value},
-a parameter that affects the process's scheduling priority.
+@command{nice} prints or modifies a process's @dfn{niceness},
+a parameter that affects whether the process is scheduled favorably.
 Synopsis:
 
 @example
 nice [@var{option}]@dots{} [@var{command} [@var{arg}]@dots{}]
 @end example
 
-If no arguments are given, @command{nice} prints the current nice
-value, which it inherited.  Otherwise, @command{nice} runs the given
-@var{command} with its nice value adjusted.  By default, its nice
-value is incremented by 10.
+If no arguments are given, @command{nice} prints the current niceness.
+Otherwise, @command{nice} runs the given @var{command} with its
+niceness adjusted.  By default, its niceness is incremented by 10.
 
-Nice values range at least from @minus{}20 (resulting in the most
+Nicenesses range at least from @minus{}20 (resulting in the most
 favorable scheduling) through 19 (the least favorable).  Some systems
-may have a wider range of nice values; conversely, other systems may
-enforce more restrictive limits.  An attempt to set the nice value
+may have a wider range of nicenesses; conversely, other systems may
+enforce more restrictive limits.  An attempt to set the niceness
 outside the supported range is treated as an attempt to use the
 minimum or maximum supported value.
 
@@ -12537,7 +12534,7 @@ Options must precede operands.
 @itemx --adjustment=@var{adjustment}
 @opindex -n
 @opindex --adjustment
-Add @var{adjustment} instead of 10 to the command's nice value.  If
+Add @var{adjustment} instead of 10 to the command's niceness.  If
 @var{adjustment} is negative and you lack appropriate privileges,
 @command{nice} issues a warning but otherwise acts as if you specified
 a zero adjustment.
@@ -12552,23 +12549,23 @@ option syntax @option{-@var{adjustment}}.  New scripts should use
 Exit status:
 
 @display
-0   if no @var{command} is specified and the current priority is output
+0   if no @var{command} is specified and the niceness is output
 1   if @command{nice} itself fails
 126 if @var{command} is found but cannot be invoked
 127 if @var{command} cannot be found
 the exit status of @var{command} otherwise
 @end display
 
-It is sometimes useful to run non-interactive programs with reduced priority.
+It is sometimes useful to run a non-interactive program with reduced niceness.
 
 @example
 $ nice factor 4611686018427387903
 @end example
 
-Since @command{nice} prints the current priority,
+Since @command{nice} prints the current niceness,
 you can invoke it through itself to demonstrate how it works.
 
-The default behavior is to increase the nice value by @samp{10}:
+The default behavior is to increase the niceness by @samp{10}:
 
 @example
 $ nice
@@ -12579,17 +12576,17 @@ $ nice -n 10 nice
 10
 @end example
 
-The @var{adjustment} is relative to the current nice value.  In the
+The @var{adjustment} is relative to the current niceness.  In the
 next example, the first @command{nice} invocation runs the second one
-with nice value 10, and it in turn runs the final one with a nice
-value that is 3 more:
+with niceness 10, and it in turn runs the final one with a niceness
+that is 3 more:
 
 @example
 $ nice nice -n 3 nice
 13
 @end example
 
-Specifying a nice value larger than the supported range
+Specifying a niceness larger than the supported range
 is the same as specifying the maximum supported value:
 
 @example
@@ -12597,11 +12594,11 @@ $ nice -n 10000000000 nice
 19
 @end example
 
-Only a privileged user may run a process with higher priority:
+Only a privileged user may run a process with lower niceness:
 
 @example
 $ nice -n -1 nice
-nice: cannot set priority: Permission denied
+nice: cannot set niceness: Permission denied
 0
 $ sudo nice -n -1 nice
 -1
@@ -12646,8 +12643,8 @@ descriptor as the (possibly-redirected) standard output.
 
 @command{nohup} does not automatically put the command it runs in the
 background; you must do that explicitly, by ending the command line
-with an @samp{&}.  Also, @command{nohup} does not change the
-scheduling priority of @var{command}; use @command{nice} for that,
+with an @samp{&}.  Also, @command{nohup} does not alter the
+niceness of @var{command}; use @command{nice} for that,
 e.g., @samp{nohup nice @var{command}}.
 
 @var{command} must not be a special built-in utility (@pxref{Special
index b008b536f04502c3306ea6b5dcbc22e8450f8428..26b56b46c74534bc23b08441fca007f071f2ce84 100644 (file)
@@ -1,4 +1,4 @@
-/* nice -- run a program with modified scheduling priority
+/* nice -- run a program with modified nice value
    Copyright (C) 1990-2005 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -44,9 +44,9 @@
 #define AUTHORS "David MacKenzie"
 
 #ifdef NICE_PRIORITY
-# define GET_NICE_VALUE() nice (0)
+# define GET_NICENESS() nice (0)
 #else
-# define GET_NICE_VALUE() getpriority (PRIO_PROCESS, 0)
+# define GET_NICENESS() getpriority (PRIO_PROCESS, 0)
 #endif
 
 #ifndef NZERO
@@ -78,11 +78,11 @@ usage (int status)
     {
       printf (_("Usage: %s [OPTION] [COMMAND [ARG]...]\n"), program_name);
       printf (_("\
-Run COMMAND with an adjusted nice value, which affects the scheduling priority.\n\
-With no COMMAND, print the current nice value.  Nice values range from\n\
+Run COMMAND with an adjusted niceness, which affects process scheduling.\n\
+With no COMMAND, print the current niceness.  Nicenesses range from\n\
 %d (most favorable scheduling) to %d (least favorable).\n\
 \n\
-  -n, --adjustment=N   add integer N to the nice value (default 10)\n\
+  -n, --adjustment=N   add integer N to the niceness (default 10)\n\
 "),
              - NZERO, NZERO - 1);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
@@ -96,7 +96,7 @@ With no COMMAND, print the current nice value.  Nice values range from\n\
 int
 main (int argc, char **argv)
 {
-  int current_nice_value;
+  int current_niceness;
   int adjustment = 10;
   char const *adjustment_given = NULL;
   bool ok;
@@ -169,25 +169,25 @@ main (int argc, char **argv)
        }
       /* No command given; print the nice value.  */
       errno = 0;
-      current_nice_value = GET_NICE_VALUE ();
-      if (current_nice_value == -1 && errno != 0)
-       error (EXIT_FAIL, errno, _("cannot get priority"));
-      printf ("%d\n", current_nice_value);
+      current_niceness = GET_NICENESS ();
+      if (current_niceness == -1 && errno != 0)
+       error (EXIT_FAIL, errno, _("cannot get niceness"));
+      printf ("%d\n", current_niceness);
       exit (EXIT_SUCCESS);
     }
 
 #ifndef NICE_PRIORITY
   errno = 0;
-  current_nice_value = GET_NICE_VALUE ();
-  if (current_nice_value == -1 && errno != 0)
-    error (EXIT_FAIL, errno, _("cannot get priority"));
-  ok = (setpriority (PRIO_PROCESS, 0, current_nice_value + adjustment) == 0);
+  current_niceness = GET_NICENESS ();
+  if (current_niceness == -1 && errno != 0)
+    error (EXIT_FAIL, errno, _("cannot get niceness"));
+  ok = (setpriority (PRIO_PROCESS, 0, current_niceness + adjustment) == 0);
 #else
   errno = 0;
   ok = (nice (adjustment) != -1 || errno == 0);
 #endif
   if (!ok)
-    error (errno == EPERM ? 0 : EXIT_FAIL, errno, _("cannot set priority"));
+    error (errno == EPERM ? 0 : EXIT_FAIL, errno, _("cannot set niceness"));
 
   execvp (argv[i], &argv[i]);