[lsb-discuss] stat(), lstat() and fstat()

Craig.Scott at csiro.au Craig.Scott at csiro.au
Wed Jan 26 01:03:00 PST 2011

I suspect these three function macros are missing from the LSB headers, but details are a bit hard to find. Here's a link to the relevant LSB page:


In particular, the last line says:

"stat(), lstat(), and fstat() are not in the binary standard; they are only in the source standard."

These three function macros should result in calls to the functions __xstat(), __lxstat() and __fxstat() respectively, all of which do have extern prototypes in the sys/stat.h headers for the LSB 4.1 packages (I'm using the ones that appeared in the LSB yum repo as of 21st Jan). It would seem to be an oversight not to provide the three stat(), lstat() and fstat() macros since without them, code would need to call  __stat() and friends which looks like it's not how these were meant to be used in source code. Or am I misunderstanding the way these are intended to be called?

For motivation, this is likely to appear as a problem in fixing an issue in the libarchive project, which is an upstream component of CMake.

Dr Craig Scott
Computational Software Engineering Team Leader, CSIRO (CMIS)
Melbourne, Australia

More information about the lsb-discuss mailing list