more nice fixes in the area of terminology

2005-09-09 Thread Paul Eggert
I see that I didn't fix all the misuses of the term nice value
so I installed this further patch.  I added a NEWS item.

2005-09-09  Paul Eggert  [EMAIL PROTECTED]

* NEWS: Document niceness vs nice value.
* configure.ac (utils_cv_func_setpriority): Simplify the tests.
Define HAVE_NICE rather than NICE_PRIORITY (since a niceness is
not a priority); all uses changed.
* src/nice.c (main): Hoist errno=0 outside the ifdef.
* doc/coreutils.texi (nice invocation): Document niceness versus
nice value versus scheduling priority.

--- NEWS29 Aug 2005 21:14:06 -  1.305
+++ NEWS9 Sep 2005 19:57:59 -
@@ -103,6 +103,11 @@ GNU coreutils NEWS  
 --indicator-style=slash.  Use --file-type or
 --indicator-style=file-type to get -p's old behavior.
 
+  nice changes:
+
+Documentation and diagnostics now refer to nicenesses (commonly
+in the range -20...19 rather than nice values (commonly 0...39).
+
   nohup changes:
 
 nohup now ignores the umask when creating nohup.out.
@@ -270,15 +275,15 @@ GNU coreutils NEWS  
 
   Fixes for nice:
 
-If it fails to lower the nice value due to lack of permissions,
+If it fails to lower the niceness due to lack of permissions,
 it goes ahead and runs the command anyway, as POSIX requires.
 
-It no longer incorrectly reports an error if the current nice
-value happens to be -1.
+It no longer incorrectly reports an error if the current niceness
+happens to be -1.
 
-It no longer assumes that nice values range from -20 through 19.
+It no longer assumes that nicenesses range from -20 through 19.
 
-It now consistently adjusts out-of-range nice values to the
+It now consistently adjusts out-of-range nicenesses to the
 closest values in range; formerly it sometimes reported an error.
 
   pathchk no longer accepts trailing options, e.g., pathchk -p foo -b
--- configure.ac23 Aug 2005 16:38:45 -  1.61
+++ configure.ac9 Sep 2005 19:57:59 -
@@ -114,29 +114,24 @@ if test $ac_cv_func_syslog = no; then
   done
 fi
 
-AC_MSG_CHECKING(for 3-argument setpriority function)
-AC_CACHE_VAL(utils_cv_func_setpriority,
-[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include sys/time.h
-  #include sys/resource.h]], [[setpriority(0, 0, 0);]])],
-  [utils_cv_func_setpriority=yes],
-  [utils_cv_func_setpriority=no])])
-AC_MSG_RESULT($utils_cv_func_setpriority)
-if test $utils_cv_func_setpriority = yes; then
-  OPTIONAL_BIN_PROGS=$OPTIONAL_BIN_PROGS nice\$(EXEEXT)
-  MAN=$MAN nice.1
-else
-  AC_MSG_CHECKING(for nice function)
-  AC_CACHE_VAL(utils_cv_func_nice,
-[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[nice();]])],
-   [utils_cv_func_nice=yes],
-   [utils_cv_func_nice=no])])
-  AC_MSG_RESULT($utils_cv_func_nice)
-  if test $utils_cv_func_nice = yes; then
-AC_DEFINE(NICE_PRIORITY, 1, [FIXME])
-OPTIONAL_BIN_PROGS=$OPTIONAL_BIN_PROGS nice\$(EXEEXT)
-MAN=$MAN nice.1
-  fi
+AC_CACHE_CHECK([for 3-argument setpriority function],
+  [utils_cv_func_setpriority],
+  [AC_LINK_IFELSE(
+[AC_LANG_PROGRAM(
+   [[#include sys/time.h
+#include sys/resource.h
+   ]],
+   [[setpriority (0, 0, 0);]])],
+[utils_cv_func_setpriority=yes],
+[utils_cv_func_setpriority=no])])
+if test $utils_cv_func_setpriority = no; then
+  AC_CHECK_FUNCS([nice])
 fi
+case $utils_cv_func_setpriority,$ac_cv_func_nice in
+*yes*)
+  OPTIONAL_BIN_PROGS=$OPTIONAL_BIN_PROGS nice\$(EXEEXT)
+  MAN=$MAN nice.1;;
+esac
 
 AC_DEFUN([coreutils_DUMMY_1],
 [
--- doc/coreutils.texi.~1.277.~ 2005-09-07 22:34:10.0 -0700
+++ doc/coreutils.texi  2005-09-09 13:49:19.0 -0700
@@ -12517,6 +12517,16 @@ enforce more restrictive limits.  An att
 outside the supported range is treated as an attempt to use the
 minimum or maximum supported value.
 
+A niceness should not be confused with a scheduling priority, which
+lets applications determine the order in which threads are scheduled
+to run.  Unlike a priority, a niceness is merely advice to the
+scheduler, which the scheduler is free to ignore.  Also, as a point of
+terminology, @acronym{POSIX} defines the behavior of @command{nice} in
+terms of a @dfn{nice value}, which is the nonnegative difference
+between a niceness and the minimum niceness.  Though @command{nice}
+conforms to @command{POSIX}, its documentation and diagnostics use the
+term ``niceness'' for compatibility with historical practice.
+
 @var{command} must not be a special built-in utility (@pxref{Special
 built-in utilities}).
 
--- src/nice.c  8 Sep 2005 06:52:09 -   1.84
+++ src/nice.c  9 Sep 2005 19:58:04 -
@@ -1,4 +1,4 @@
-/* nice -- run a program with modified nice value
+/* nice -- run a program with modified niceness
Copyright (C) 1990-2005 Free Software Foundation, Inc.
 
This program is free software; you can redistribute it and/or modify

Re: Where can i get the design documentation for core utils?

2005-09-09 Thread Eric Blake
 Where can i get the design documentation for core utils? i.e basic algorithm 
 for 
 the utilities. Sometimes it is difficult to know what a particular code 
 fragment 
 is doing by just looking at the code  itself.

Unfortunately, you've stumbled across one of the weakness of open source.
Many of the coreutils come from varied backgrounds, with varying levels of
documentation, and there is no cohesive design document (besides reading
the code itself).  Contributions to improve the documentation and code
comments are greatly appreciated.

--
Eric Blake




___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: more nice fixes in the area of terminology

2005-09-09 Thread Andreas Schwab
Paul Eggert [EMAIL PROTECTED] writes:

 --- NEWS  29 Aug 2005 21:14:06 -  1.305
 +++ NEWS  9 Sep 2005 19:57:59 -
 @@ -103,6 +103,11 @@ GNU coreutils NEWS  
  --indicator-style=slash.  Use --file-type or
  --indicator-style=file-type to get -p's old behavior.
  
 +  nice changes:
 +
 +Documentation and diagnostics now refer to nicenesses (commonly
 +in the range -20...19 rather than nice values (commonly 0...39).

Typo: a close paren is missing.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: more nice fixes in the area of terminology

2005-09-09 Thread Paul Eggert
Andreas Schwab [EMAIL PROTECTED] writes:

 +Documentation and diagnostics now refer to nicenesses (commonly
 +in the range -20...19 rather than nice values (commonly 0...39).

 Typo: a close paren is missing.

Thanks; I fixed that.


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


csplit corrupts files with long lines

2005-09-09 Thread Tristan Miller
Greetings.

I'm reporting a bug with csplit coreutils 5.2.1, compiled from sources on a 
SuSE 9.3 system.  It seems this bug was previously reported over a year 
ago (see 
http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00112.html) 
but it was never squashed.

In short, csplit produces corrupt output when the input file contains very 
long lines.  An example file is at 
http://www.dfki.uni-kl.de/~miller/tmp/wikipedia.xml, an XML file 
containing three articles from Wikipedia.  The second article was 
vandalized by a spammer who inserted a ridiculously long line (42280 
characters) full of links.

If I try to split this file with

$ csplit wikipedia.xml '/page/' '{*}'

then the file with the second article, xx02, is garbled at the beginning of 
the long line.  See http://www.dfki.uni-kl.de/~miller/tmp/xx02.

Regards,
Tristan

-- 
   _
  _V.-o  Tristan Miller [en,(fr,de,ia)]Space is limited
 / |`-'  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=In a haiku, so it's hard
(7_\\http://www.nothingisreal.com/ To finish what you


pgpppyH8NXPWm.pgp
Description: PGP signature
___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils