From bd5e996e20abbcbf98c0f77748c83a654e9784a2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 31 Oct 2011 14:44:32 +0000 Subject: [PATCH] =?UTF-8?q?*=20Apply=20a=20patch=20to=20fix=20the=20"max?= =?UTF-8?q?=20resident"=20size=20reported=20by=20=E2=80=98time=E2=80=99=20?= =?UTF-8?q?=20=20being=20off=20by=20a=20factor=20of=204.=20=20(The=20most?= =?UTF-8?q?=20recent=20release=20of=20=E2=80=98time=E2=80=99=20is=20=20=20?= =?UTF-8?q?from=201996=20BTW...)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/nixpkgs/trunk/; revision=30143 --- pkgs/tools/misc/time/default.nix | 2 ++ pkgs/tools/misc/time/max-resident.patch | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/tools/misc/time/max-resident.patch diff --git a/pkgs/tools/misc/time/default.nix b/pkgs/tools/misc/time/default.nix index 658afb37c03..05ab7cc7ae7 100644 --- a/pkgs/tools/misc/time/default.nix +++ b/pkgs/tools/misc/time/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation { sha256 = "0va9063fcn7xykv658v2s9gilj2fq4rcdxx2mn2mmy1v4ndafzp3"; }; + patches = [ ./max-resident.patch ]; + meta = { description = "GNU Time, a tool that runs programs and summarizes the system resources they use"; diff --git a/pkgs/tools/misc/time/max-resident.patch b/pkgs/tools/misc/time/max-resident.patch new file mode 100644 index 00000000000..e593d833d5e --- /dev/null +++ b/pkgs/tools/misc/time/max-resident.patch @@ -0,0 +1,16 @@ +Fix the "max resident" size reported by ‘time’ being off by a factor of 4. + +From http://lists.gnu.org/archive/html/help-gnu-utils/2010-10/msg00002.html + +diff -ru -x '*~' time-1.7-orig/time.c time-1.7/time.c +--- time-1.7-orig/time.c 1996-06-13 15:38:21.000000000 -0400 ++++ time-1.7/time.c 2011-10-31 10:40:27.000000000 -0400 +@@ -392,7 +392,7 @@ + ptok ((UL) resp->ru.ru_ixrss) / MSEC_TO_TICKS (v)); + break; + case 'M': /* Maximum resident set size. */ +- fprintf (fp, "%lu", ptok ((UL) resp->ru.ru_maxrss)); ++ fprintf (fp, "%lu", (UL) resp->ru.ru_maxrss); + break; + case 'O': /* Outputs. */ + fprintf (fp, "%ld", resp->ru.ru_oublock);