Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!swrinde!dptspd!sat.datapoint.com From: lcz@sat.datapoint.com (Lee Ziegenhals) Newsgroups: comp.bugs.sys5 Subject: Bug in SVR4 BSD-compatibility library (libucb) Message-ID: <867@dptspd.sat.datapoint.com> Date: 25 Jan 91 17:50:04 GMT Sender: lcz@dptspd.sat.datapoint.com Organization: Datapoint Corporation, San Antonio, TX Lines: 17 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@sat.datapoint.com)