After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 337098 - Configure failure under NetBSD
Configure failure under NetBSD
Status: RESOLVED OBSOLETE
Product: libgtop
Classification: Core
Component: bsd
2.15.x
Other NetBSD
: Normal major
: ---
Assigned To: libgtop maintainers
libgtop maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-03 21:48 UTC by Julio Merino
Modified: 2018-01-10 19:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch. (7.04 KB, patch)
2006-04-03 21:48 UTC, Julio Merino
none Details | Review

Description Julio Merino 2006-04-03 21:48:00 UTC
The configure process aborts prematurely under NetBSD because it cannot find any function to retrieve the list of mounted file systems.  In the past it used to work because the script properly detected the 4.4BSD getmntinfo routine as provided by NetBSD.

However, starting with NetBSD 3.0, the getmntinfo prototype was changed to use the statvfs structure instead of statfs.  This also changed the required #include's to get the function definition -- something that makes the configure check fail because it relies solely on grepping the delicate system headers (a very error prone way to check for features).

Therefore, we are now faced with two different getmntinfo implementations.  The new, NetBSD-specific one:

     #include <sys/types.h>
     #include <sys/statvfs.h>

     int
     getmntinfo(struct statvfs **mntbufp, int flags);

And the legacy one:

     #include <sys/param.h>
     #include <sys/mount.h>

     int
     getmntinfo(struct statfs **mntbufp, int flags);

The configure script needs to check which one is available and use it accordingly in the code.  It'd be good to check for the feature instead of assuming that the first implementation is provided by NetBSD alone; this way, if other OSes switch, libgtop will continue to work on them.  This is what the attached patch does.

Furthermore, I've seized the opportunity to add a check for the f_fstypename field in either the statfs or the statvfs structures, which is somewhat related to this issue.  This makes the code more OS-independent because it does not rely any more on OS-specific macros (e.g. __NetBSD__) and instead uses macros OS-agnostic defined by configure.
Comment 1 Julio Merino 2006-04-03 21:48:54 UTC
Created attachment 62701 [details] [review]
Proposed patch.
Comment 2 GNOME Infrastructure Team 2018-01-10 19:44:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libgtop/issues/5.