Bug in SVR4 BSD-compatibility library (libucb)

Doug Gwyn gwyn at smoke.brl.mil
Sat Jan 26 18:09:01 AEST 1991


In article <867 at dptspd.sat.datapoint.com> lcz at sat.datapoint.com (Lee Ziegenhals) writes:
>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 *).

There is the real problem.  Even on BSD systems, it would be preferable to
use a POSIX-compatible interface (one of which I provide), and future
releases of BSD will provide that.

I understand the desire for the "compatibility library" to support
struct direct etc. in order to permit recompilation of obsolete code
without having to edit it first.  However, it would be much better to
modernize the out-of-date source code than to promulgate support for
obsolete interfaces forever.

>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.

Gack!  Your "temporary" solution is MUCH better than your "proper" one.
We should NOT be encouraging the proliferation of the obsolete non-POSIX
*dir() interfaces.  As for the next BSD release, getwd() and scandir()
should use the POSIX interface.



More information about the Comp.bugs.sys5 mailing list