What not to be doing - syscall()

Daniel Stone dstone at kde.org
Mon Dec 22 23:09:31 GMT 2003


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031223/0e87766f/attachment.sig>


More information about the kde-core-devel mailing list