Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!sgi!shinobu!odin!moose.asd.sgi.com!jwag From: jwag@moose.asd.sgi.com (Chris Wagner) Newsgroups: comp.sys.sgi Subject: Re: problem with scandir Keywords: dumps core Message-ID: <1991Mar27.163133.19962@odin.corp.sgi.com> Date: 27 Mar 91 16:31:33 GMT References: <1991Mar25.191630.939@cs.ruu.nl> Sender: news@odin.corp.sgi.com (Net News) Reply-To: jwag@moose.asd.sgi.com (Chris Wagner) Organization: Silicon Graphics, Research & Development Lines: 32 In article <1991Mar25.191630.939@cs.ruu.nl>, markov@cs.ruu.nl (Mark Overmars) writes: > I have a problem with the routine scandir. After some stripping I came up with > the following program: > > #include > #include > > main() > { > struct direct **namelist; > scandir("/bin", &namelist, NULL, NULL); > } > > It dumps core. It does not do so for any other directory than /bin. > (Same behaviour on two unrelated machines.) Any reason why and any suggestions > how to solve it? > > Mark Overmars THis is a bug in scandir in 3.3 - having to do with how much memory scandir will allocate to hold the directory entries. It gueses based on the stat size of the directory using a heuristic designed for BSD FFS which doesn't always work on EFS. If you simply add another entry to /bin it will probably start working. It has been fixed in 4.0 Chris Wagner