Bug 58150 - Ksim 1.0.0 filesystem plugin does not build with mntent.h on Solaris.
Summary: Ksim 1.0.0 filesystem plugin does not build with mntent.h on Solaris.
Status: RESOLVED FIXED
Alias: None
Product: ksim
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Reuben Sutton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-05 21:02 UTC by Lars Tunkrans
Modified: 2008-08-01 14:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
solaris fsystem patch (4.27 KB, patch)
2003-05-11 11:45 UTC, Robbie Ward
Details
fsystemstats.cpp (4.70 KB, text/x-c++src)
2003-05-11 11:46 UTC, Robbie Ward
Details
fsystemstats.h (1.13 KB, text/x-chdr)
2003-05-11 11:46 UTC, Robbie Ward
Details
correct solaris fsystem patch (4.27 KB, patch)
2003-05-11 12:26 UTC, Robbie Ward
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Tunkrans 2003-05-05 21:02:23 UTC
Version:            (using KDE KDE 3.1.1a)
Installed from:    Compiled From Sources
Compiler:          gcc 3.2.2 
OS:          Solaris

When bug 58149  is fixed  another problem appears in KSIM 1.0.0

  Referreing to the compiletime trace below :

----------------------------
  From the SunOS 4 to Solaris 2 transition Guide: ( written 10 years ago ) 

    setmntent()(3) :  The fopen()(3) followed by the lockf()(3) routines provide   similar functionality.

    endmntent()(3) :   This routine is replaced by fclose()(3).

-----------------------------

    getmntent() (3) :  is defined  in  <sys/mnttab.h>


  Here is the compile trace.
 

  /bin/bash ../../../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../../ksim/library -I/usr/local/kde/include -I/usr/local/qt/include    -DQT_THREAD_SUPPORT -I/usr/local/include -I/usr/sfw/include -I/opt/sfw/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -O3 -mcpu=ultrasparc -mtune=ultrasparc -Wa,-xarch=v8plusa -fno-exceptions -fno-check-new -DQT_CLEAN_NAMESPACE  -DQT_NO_ASCII_CAST  -c -o fsystemconfig.lo `test -f 'fsystemconfig.cpp' || echo './'`fsystemconfig.cpp
fsystemconfig.cpp: In member function `void FsystemConfig::getStats()':
fsystemconfig.cpp:185: `setmntent' undeclared (first use this function)
fsystemconfig.cpp:185: (Each undeclared identifier is reported only once for
   each function it appears in.)
fsystemconfig.cpp:188: `getmntent' undeclared (first use this function)
fsystemconfig.cpp:189: invalid use of undefined type `struct mntent'
fsystemconfig.cpp:186: forward declaration of `struct mntent'
fsystemconfig.cpp:190: invalid use of undefined type `struct mntent'
fsystemconfig.cpp:186: forward declaration of `struct mntent'
fsystemconfig.cpp:191: invalid use of undefined type `struct mntent'
fsystemconfig.cpp:186: forward declaration of `struct mntent'
fsystemconfig.cpp:191: invalid use of undefined type `struct mntent'
fsystemconfig.cpp:186: forward declaration of `struct mntent'
fsystemconfig.cpp:194: `endmntent' undeclared (first use this function)
gmake[2]: *** [fsystemconfig.lo] Error 1
gmake[2]: Leaving directory `/opt/src/kde311/kdeutils-3.1.1/ksim/monitors/filesystem'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/opt/src/kde311/kdeutils-3.1.1/ksim/monitors'
gmake: *** [all-recursive] Error 1
Comment 1 Robbie Ward 2003-05-06 22:48:08 UTC
could you maybe remove the #ifdef HAVE_MNTENT_H and the code leading it so the other method 
can take over to see if that helps any? I plan on re-writing the way getStats() work to something more 
generic to make it easier for new methods (if needed) to be added for kde 3.2, but in the meantime this 
needs fixing first. 
 
Comment 2 Lars Tunkrans 2003-05-07 01:01:51 UTC
 HAVE_SYS_UCRED_H  is undef:ed  so that logic does not work.
I would not work anyway since  SYSTEM V release 4  unixes  evolved from 
using the filesystem table to the VIRTUAL filesystemtable.
the systemcalls and subroutines are :


fstatvfs        statvfs (2)     - get file system information
getvfsany       getvfsent (3c)  - get vfstab file entry
getvfsent       getvfsent (3c)  - get vfstab file entry
getvfsfile      getvfsent (3c)  - get vfstab file entry
getvfsspec      getvfsent (3c)  - get vfstab file entry
statvfs         statvfs (2)     - get file system information
vfscanf         scanf (3c)      - convert formatted input
vfstab          vfstab (4)      - table of file system defaults

Some Links to the VFS manpages on http://docs.sun.com

http://docs.sun.com/db/doc/816-0212/6m6nd4nek?a=view#indexterm-276

http://docs.sun.com/db/doc/816-0213/6m6ne382q?a=view#indexterm-596

  I am NOT  demanding that this be fixed right now.
  I am just pointing out that this code is not very portable outside 
  LINUX/ FreeBSD. I want KDE to work on the Main UNIX  platforms.  
Comment 3 Robbie Ward 2003-05-10 23:24:41 UTC
Ok, i have a system working here that should fix your problem, but i need to find out if you have a 
_PATH_MOUNTED define in any of your installed headers (its in /usr/include/paths.h on linux) if you 
dont have such a define, could you let me know what the mtab file is called and its location if its any 
different to linux? once i've got this information i'll send you a patch to see if it works. 
Comment 4 Lars Tunkrans 2003-05-11 01:49:58 UTC
Subject: Re:  Ksim 1.0.0  filesystem plugin does not build with
 mntent.h  on Solaris.

I have mailed some dumps of the Solaris 9 :

mnttab  manpage
the /usr/include/sys/mnttab.h  header file
a snapshot of /etc/mnttab  contents

directly  to the developer.

//

Comment 5 Robbie Ward 2003-05-11 11:44:33 UTC
Hi, the following patch and file should fix this, if it doesnt edit filesystemstats.cpp and add #undef 
HAVE_SYS_MNTTAB_H on line 85 and the failsafe option should take over, which should then fix your 
problem. 
 
Also, please note that you will need to rerun make -f Makefile.cvs and ./configure 
Comment 6 Robbie Ward 2003-05-11 11:45:32 UTC
Created attachment 1519 [details]
solaris fsystem patch
Comment 7 Robbie Ward 2003-05-11 11:46:16 UTC
Created attachment 1520 [details]
fsystemstats.cpp
Comment 8 Robbie Ward 2003-05-11 11:46:41 UTC
Created attachment 1521 [details]
fsystemstats.h
Comment 9 Robbie Ward 2003-05-11 12:26:12 UTC
Created attachment 1523 [details]
correct solaris fsystem patch

Sorry, this is the correct patch
Comment 10 George Goldberg 2008-02-18 03:58:26 UTC
Is this bug still present in a recent KDE version, such as 3.5.9 or 4.0.1?
Comment 11 groot 2008-08-01 14:02:30 UTC
Fixed in KDE 3.4.3 packages; KDE4 has transitioned to the vfs calls for Solaris.