Bug in SVR4 BSD-compatibility library (libucb)

Lee Ziegenhals lcz at sat.datapoint.com
Sat Jan 26 04:50:04 AEST 1991


There appears to be a bug in the BSD compatibility library in SVR4.  The
library includes the BSD version of readdir(3) which returns (struct direct *).
This routine is not mentioned in the BSD/Xenix Compatibility Guide, but it is
included in /usr/ucbinclude/sys/dir.h.  The problem is that getwd(3) and
scandir(3) both use the SYSV definition of readdir, which returns
(struct dirent *)!  The result is that if you include ucblib, getwd and
scandir do not work, because they end up calling the BSD readdir while
expecting the SYSV readdir.

My temporary solution was to remove readdir from libucb, so that getwd and
scandir call the SYSV readdir.  The proper solution appears to be to modify
getwd and scandir to use the BSD readdir.  However, I am curious about the fact
that readdir does not appear in the compatibility guide.  Has anyone else seen
this?  Are there any SVR4 versions that have fixed this problem?  I am running
the unmodified AT&T SVR4 V2.0.

Lee Ziegenhals (lcz at sat.datapoint.com)



More information about the Comp.bugs.sys5 mailing list