I wish I could take that advice, but getpwent_r is not available on OpenBSD. I do take care to call it sequentially, and the call is not being made from, say, multiple Scheme threads. Invocation of each loop in the (let loop ...) would have to be reordered by the compiler (I don't believe that is permitted, but would result in out-of-order records at worst, no?) or the runtime would have to make a call to getpwent while I'm doing my loop, and I find no reference to getpwent in Chicken's source code.
I'd like to use a pattern like this in multiple places: anywhere I construct a record from C and want to pass it to Scheme, not just reading the /etc/passwd file. I could rewrite this to read records from an arbitrary file and suspect I'd still be getting this error. Thank you, -a On Sun, Dec 08, 2013 at 12:21:24PM -0500, John Cowan wrote: > .alyn.post. scripsit: > > > I'm trying to read /etc/passwd using getpwent(3) and store each > > record returned in a scheme list. > > The very first thing I would try is switching to getpwent_r(), because > the fact that getpwent() uses a static buffer internally may well be > confusing Chicken. > > -- > John Cowan <[email protected]> http://www.ccil.org/~cowan > Raffiniert ist der Herrgott, aber boshaft ist er nicht. > --Albert Einstein > > _______________________________________________ > Chicken-users mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/chicken-users -- my personal website: http://c0redump.org/ _______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
