What not to be doing - syscall()
Andrew Stanley-Jones
asj at cban.com
Tue Dec 23 23:06:27 GMT 2003
Daniel,
Wrt to ksirc you're right it's a syscall, but 6 years ago when the code
was written it was the best way to do it, and I still think it is. It
tries it's best to be portable, and it works on most platforms. If it
doesn't, no big deal your lag times get reported in second intervals.
Big deal.
Timer::HiRes isn't portable, I don't ever have it, so please leave
working code alone.
-Andrew
On Tue, Dec 23, 2003 at 10:09:31AM +1100, Daniel Stone wrote:
> Hi guys,
> In kdebase/kcontrol/info/memory_linux.cpp:
> 1.3 (deller 07-Jan-00): syscall(SYS_sysinfo, &info); /* Get Information from system... */
>
> This is a pretty good example of what *not* to do. syscall() is not
> portable across architectures (it caused a recent FTBFS[1] on
> mips/mipsel for Debian packages). To do this, use sysinfo(&info)
> instead.
>
> There are more instances in kdeadmin/kuser/quota.cpp,
> kdenetwork/ksirc/filters.pl (seriously, what is that? use Timers::HiRes
> anyway), and kdeutils/ksim/systeminfo.cpp; I've CCed the people that cvs
> bla^H^H^Hannotate identified as responsible for those lines. I intend to
> start fixing this on *both* HEAD and _BRANCH, because it's just wrong,
> and causes a world of hurt (the world is more than just i386).
>
> Cheers,
> Daniel
>
> [1]: Failure to build from source - my link is too slow for me to easily
> change that, so I footnoted it.
> [2]: If you desperately need some defines, like from cdrom.h, copy them
> into a header of your own.
>
> --
> Daniel Stone <dstone at kde.org>
> Developer, KDE project: http://www.kde.org
--
Andrew Stanley-Jones | "It's kind of fun to do the impossible."
EE, LongEz N87KJ | -- Walt Disney
More information about the kde-core-devel
mailing list