1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../torsmo/getloadavg.patch
5 # Copyright (C) 2007 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 --- torsmo-0.18/linux.c.vanilla 2004-12-21 21:20:07.000000000 +0000
18 +++ torsmo-0.18/linux.c 2007-01-14 21:05:47.000000000 +0000
23 +/* uclibc and dietlibc do not have this junk -ReneR */
24 +#if defined (__UCLIBC__) || defined (__dietlibc__)
25 +static int getloadavg (double loadavg[], int nelem)
29 + fd = open ("/proc/loadavg", O_RDONLY);
38 + nread = read (fd, buf, sizeof buf - 1);
42 + buf[nread - 1] = '\0';
47 + for (i = 0; i < nelem; ++i)
50 + loadavg[i] = strtod (p, &endp);
61 void update_load_average() {
62 #ifdef HAVE_GETLOADAVG