Bug 99100 - kasbar fails to compile on solaris 2.6 because it uses getloadavg which is not available
Summary: kasbar fails to compile on solaris 2.6 because it uses getloadavg which is no...
Status: RESOLVED FIXED
Alias: None
Product: kasbar
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Richard Moore
URL:
Keywords:
: 104123 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-11 10:46 UTC by Steve Evans
Modified: 2008-08-01 13:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Evans 2005-02-11 10:46:45 UTC
Version:            (using KDE KDE 3.3.92)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.3 
OS:                Solaris

I get this compile error on Solaris 2.6:

if /bin/ksh ../../../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I./../../taskmanager -I/opt/kde/include -I/opt/qt/include   -I/gorbag/exta/cad/externals/SOLARIS/include  -DQT_THREAD_SUPPORT -I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include  -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include -O2 -fomit-frame-pointer -DNeedVarargsPrototypes=1 -DNeedFunctionPrototypes=1 -pipe -fno-exceptions -mcpu=ultrasparc -fno-exceptions -fno-check-new -fno-common -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -D_GNU_SOURCE  -MT kasloaditem.lo -MD -MP -MF ".deps/kasloaditem.Tpo" -c -o kasloaditem.lo kasloaditem.cpp; \
then mv -f ".deps/kasloaditem.Tpo" ".deps/kasloaditem.Plo"; else rm -f ".deps/kasloaditem.Tpo"; exit 1; fi
kasloaditem.cpp: In member function `void KasLoadItem::updateDisplay()':
kasloaditem.cpp:47: error: `getloadavg' undeclared (first use this function)
kasloaditem.cpp:47: error: (Each undeclared identifier is reported only once for each function itappears in.)
Comment 1 Bernd Kuhls 2005-02-16 14:48:19 UTC
I solved this problem on Solaris 9 by adding

#include <sys/loadavg.h>

to kdebase/kicker/extensions/kasbar/kasloaditem.cpp
Comment 2 Steve Evans 2005-02-16 14:55:39 UTC
Unfortunately that won't solve it on Solaris 2.6 :-(
Comment 3 Richard Moore 2005-02-19 23:26:05 UTC
That's infuriating - this function has been present since 4.3 BSD, and lives in stdlib.h there. Do you know an equivalent that will work there, or I'll have to leave it for the porting team. :-(
Comment 4 Steve Evans 2005-02-21 11:12:10 UTC
Unfortunately I don't know of any equivalent on 2.6. I will look into it.
Comment 5 Aaron J. Seigo 2005-02-22 09:16:40 UTC
from my googling, it appears that all sorts of software doesn't compile on solaris 2.6 due to the omission of loadavg. apparently it was added later; i'd consider this an operating system related bug, realy, rather than a kasbar one.

perhaps we can just disabled kasbar (or at least this code?) from being compiled under solaris 2.6
Comment 6 Steve Evans 2005-02-22 10:39:42 UTC
I would be happy if either kasbar, or just this code, was prevented from compiling under solaris 2.6.
Comment 7 Bernd Kuhls 2005-02-23 15:14:43 UTC
And I would be happy if that the missing include line gets included in CVS code so Solaris 2.9 users can compile without patching the code.
Comment 8 Richard Moore 2005-03-25 17:34:34 UTC
CVS commit by rich: 

Patch from Michael Ritzert  <kde@ritzert.de> for solaris.

CCMAIL: 99100@bugs.kde.org


  M +5 -0      kasloaditem.cpp   1.5


--- kdebase/kicker/extensions/kasbar/kasloaditem.cpp  #1.4:1.5
@@ -2,4 +2,9 @@
 #include <stdlib.h>
 
+#include <config.h>
+#ifdef HAVE_SYS_LOADAVG_H
+#include <sys/loadavg.h> // e.g. Solaris
+#endif
+
 #include <qpainter.h>
 #include <qbitmap.h>
Comment 9 Richard Moore 2005-03-25 17:38:11 UTC
CVS commit by rich: 

Patch from Michael Ritzert <kde@ritzert.de> for solaris.
CCMAIL: 99100@bugs.kde.org
BACKPORT


  A            configure.in.in   1.1.2.1
  M +5 -0      kasloaditem.cpp   1.4.2.1


--- kdebase/kicker/extensions/kasbar/kasloaditem.cpp  #1.4:1.4.2.1
@@ -2,4 +2,9 @@
 #include <stdlib.h>
 
+#include <config.h>
+#ifdef HAVE_SYS_LOADAVG_H
+#include <sys/loadavg.h> // e.g. Solaris
+#endif
+
 #include <qpainter.h>
 #include <qbitmap.h>
Comment 10 Aaron J. Seigo 2005-04-18 09:21:58 UTC
*** Bug 104123 has been marked as a duplicate of this bug. ***
Comment 11 groot 2008-08-01 13:32:16 UTC
Solaris 2.6 EOL-ed in 2006. KDE 3.4.3 packages work around this issue. Patches committed. KDE4 has different load handling methods.