GNOME Bugzilla – Bug 346021
libgtop can't get net load at Solaris
Last modified: 2007-10-10 08:14:56 UTC
Please describe the problem: libgtop can't get net load at Solaris, the relative function is null Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? yes Other information:
Created attachment 68104 [details] [review] patch for netload at Solaris
#include <linux/ ...
sorry, a little busy, and forget to delete all of the unuseful ones. Please see the new patch... :)
Created attachment 68109 [details] [review] new patch
could you glibify it please ? + * chop off the trailing interface and + */ + module = strdup( name ); + ptr = module + strlen( module ) - 1; + while( (ptr > module) && isdigit( (int) *ptr ) ) { + *ptr = '\0'; + ptr--; + } i'm sure you can find in glib strinfs function some stuff to do that easily. No malloc/free please, use glib. g_strchomp(g_strdelimit(module, "0123456789", ' ')) maybe ? have you tried the ipv6 support ? is OK ?
Benoit, Thanks for your suggestion, it's very useful. at least I try to understand the glib API. :) But I am concerning, if we use g_strdelimit(module, "0123456789", ''), maybe we will destroy something in module, g_strdelimit() explain "Any characters in string which are found in delimiters are changed to the new_delimiter character", it means if the module is ip6stat, it will change 6 too, and the original program is just want to delete the number in the end of module. What's your comments? If I am wrong, please correct me. Sorry, I am not test ipv6, becaue I didn't use ipv6 now. I keep the get_ipv6() there, because I think maybe later we can use some of it.. :)
so you don't even know if the ipv6 code you copied from linux works on solaris ?
I didn't test ipv6 code, I keep them there, because I think they are useful in the future, so if you think I can't confirm the ipv6 code, could we just delete these codes?
Benoit, I took a review the get_ipv6() with our colleagues, seems this function can't work on Solaris, I am sorry. So what your prefer? deleting this function and checkin this patch(this patch can work correctly without call get_ipv6), or wait until I find a way to implement it?
I double checked the code, I know why it didn't run at Solaris, because there is a macro HAVE_IFADDRS_H, when we have ifaddrs.h, get_ipv6() code will run, but in fact at Solaris, there is no by now...
just drop broken code :) ipv6 can wait.
I contacted the ipv6 engineer, now there is no any reply, so could we integrate the other part, and once I make the implementation of get_ipv6() available, I will provide it..
(In reply to comment #11) > just drop broken code :) ipv6 can wait. >
which is the status of this issue? May be solved before 2.18? (Changed to NEW, because it seems to exists according the comments)
I'm waiting for a patch split.
Sorry for late reply, German and Benoit, I am busy in a priority 1 project for Solairs for a while, really can't find time on this, I will try to see if anyone else can help me on this... BTW, what's 2.18 deadline?
Created attachment 81169 [details] [review] new patch comment ipv6 out
sorry, maybe the patch split is just the patch need to comment out ipv6 implement? if so, please check the new patch, these days I have time, and can start work on it, but it can be accepted partly?
I'm not sure if this report should be closed without reviewing the patch. Benoît, is it possible to take a look at the pending patch? and made sompe comment. Thanks.
As i have already said, i want the patch to be cleaned: either provide an IPv6 implementation or don't. But i don't want dead linux code in it.
I didn't see any words to describe your comments, I asked your comments before, but no any reply. You may need to give some comments to tell others what you think. Will provide a new patch without ipv6 and Linux codes....
New patch attached, please review. I also added the ChangLog diff under sysdep/solaris, I am not sure if this diff is ok, if not, please let me know...
Created attachment 96880 [details] [review] netload.c patch
Created attachment 96881 [details] [review] ChangeLog diff
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.