Bug: cfg_dir doesn't work on solaris..?

Jan Grant jan.grant at bristol.ac.uk
Tue Jan 22 19:16:11 CET 2008


On Tue, 22 Jan 2008, Brian A. Seklecki wrote:

> It doesn't work in FreeBSD either -- don't get your hopes up.  We
> reported it over a month ago to no avail.  W/O a tracker you're just
> pissing in the wind.

That's rather odd; FreeBSD includes d_type (it's originally a BSDism I 
think) - perhaps the configure script doesn't detect it properly...

... it seems so: _DIRENT_HAVE_D_TYPE doesn't get defined, which is what 
the xodtemplate.c code is dependent on...

... ah, there it is, in a Linux /usr/include/dirent.h: if you look at a 
linux manpage for readdir, the NOTES says:

[[[
NOTES

Only the fields d_name and d_ino are specified in POSIX.1-2001. The 
remaining fields are available on many, but not all systems. Under 
glibc, programs can check for the availability of the fields not defined 
in POSIX.1 by testing whether the macros _DIRENT_HAVE_D_NAMLEN, 
_DIRENT_HAVE_D_RECLEN, _DIRENT_HAVE_D_OFF, or _DIRENT_HAVE_D_TYPE are 
defined.
]]]

... so this looks like a "glibcism".

To get this working under FreeBSD it may be simply sufficient to hack a

[[[
#define _DIRENT_HAVE_D_TYPE
]]]

into include/config.h before making...

...hm, having just tried it, that might just sort you out :-) The 
situation on solaris is a little more harsh, since it has no d_type. 
I'll sort out a patch to do that and something a little more convincing 
for common.h that detects BSD systems.

Cheers,
jan


-- 
jan grant, ISYS, University of Bristol. http://www.bris.ac.uk/
Tel +44 (0)117 3317661   http://ioctl.org/jan/
ioctl(2): probably the coolest Unix system call in the world

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/




More information about the Developers mailing list