A Debian GNU/kFreeBSD user reported that xfce4-cpugraph-plugin couldn't be built using this special suite. He provided a patch (attached) to fix this. Regards, -- Yves-Alexis Perez
Created attachment 1051 fix ftbfs on GNU/kFreeBSD
I am a bit confused by this patch. Personally, I don't use Debian GNU/kFreeBSD, but I'd be glad to provide support for it. As far as I know (see the link below), Debian GNU/kFreeBSD uses FreeBSD's kernel APIs. http://wiki.debian.org/Debian_GNU/kFreeBSD_FAQ#Q.3AWhichsyscallkernelinterfaceisusedbybinariescompiledforDebianGNU.2BAC8-kFreeBSD.3F In that case, shouldn't we build xfce4-cpugraph on Debian GNU/kFreeBSD the same way as it is build on FreeBSD, rather than on linux? The only part that is OS dependent is the one that queries the Kernel for CPU usage.
Yep but it's Debian GNU/kFreeBSD, meaning we use the GNU libc (in fact eglibc, but still).
This part of the code behind #ifdef __linux__ isn't using the glibc in particular. It is using the /proc filesystem to find information from the kernel, and that is typical of the linux kernel. I suppose (and googling around seems to confirm that) that freebsd provides an emulation of that linux proc file system, so that's why the patch works. But it works because Freebsd supports /proc, not because GNU/kFreeBSD uses glibc. There is no guarantee that /proc will be available on any operating system that uses glibc. So using __GLIBC__ isn't a reliable way of checking if /proc is available. That said, I am interested in supporting GNU/kFreeBSD, so I'll apply a similar patch, but rather that __GLIBC__, following the guideline posted in the link below, I'll be using __FreeBSD_kernel__. http://glibc-bsd.alioth.debian.org/porting/PORTING What I still have to see is if I'll read from /proc or if I'll use the FreeBSD system call. The second options sounds more native to GNU/kFreeBSD to me, but either way would be fine. In any case, you can expect GNU/kFreeBSD support for 0.5
Hmhm, I didn't test the patch myself, and I'm not sure there's a /proc under kFreeBSD. Maybe the patch was just enough to build cpugraph but not enough for make it work. If you need test builds I have access to a kFreeBSD machine (without X running though so I can't test afterwards)
mhm, after checking, yes there's some kind of /proc emulation: io% uname -a GNU/kFreeBSD io.debian.net 8.0-1-686 #0 Wed Jan 27 12:33:10 UTC 2010 i686 i386 AMD Sempron(tm) Processor 2600+ GNU/kFreeBSD io% ls /proc 0 13 1360 286 59091 70842 71581 84962 mounts version 1 13295 14 3 6 70960 71583 84994 mtab 10 13296 15 30999 66706 71018 71584 9 net 10542 13307 16 349 66709 71019 71591 99488 partitions 10543 1355 17 36299 66710 71158 76167 cmdline scsi 11 1356 18 4 7 71433 76231 cpuinfo self 12 1357 19 440 704 71476 7700 devices stat 1202 1358 2 473 705 71478 8 loadavg sys 1223 1359 22965 5 706 71492 800 meminfo uptime
Thanks for the info. I have a few other things to do first, but I'll comment again here bug when I get to this.
I committed a fix for this, letting GNU/kFreeBSD use the linux /proc emulation to fetch cpu data. As I don't have access to a GNU/kFreeBSD machine, I'd be grateful if someone could report if it compiles and runs as expected.