[fpc-devel] the libc unit on 64-bit systems

Marco van de Voort marcov at stack.nl
Fri Feb 1 09:59:54 CET 2008

> Op Thu, 31 Jan 2008, schreef Graeme Geldenhuys:
> > Wow you guys reply quickly. :)  The above code doesn't look nice
> > either, so I think I will rather implement a alternative.

(Daniel's is better, I still have the habit to make 1.0.x compat defines,
while not necessary anymore)

> > All I really use 'libc' for is to retrieve the user name and group
> > name from the user and group id's of files.  As I said, it's not
> > critical, I can always display the id's only.  Or maybe parse the
> > /etc/groups and /etc/passwd files to get the names, but I heard that's
> > not very accurate for some reason.
> >
> > Thanks again Marco and Dani?l for the quick replies!
> Rather than use the libc unit, you might want to declare getpwent in your 
> own code; a few naming service procedures are a whole lot easier to keep 
> portable than the entire libc unit.

If 2.3.1 for Linux one can probably use package users. I plan to update this
coming weekend to BSD compability. (the group part is mostly done already).

Afaik 2.2.0 has this package too, but it wasn't compiled till the recent
package restructure (Which will be merged to 2.2 in the coming weeks
> This doesn't guarantee you anything (getpwent could well be a 
> macro on a random unix),

Not uncommon even, since some only have the _r variant iirc.

> but it wouldn't be that much work to make it work on the known Unixes.

Better focus that to an area where all benefit. This abstraction is simple
to do, and often needed. However all people till now blindly grab libc or
hack their own, and refuse to invest time in the general units.

I hope that the reviving of the (Michael abandonware)  users package will
start this proces.

More information about the fpc-devel mailing list