bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st_dev in struct stat


From: Thomas Bushnell, BSG
Subject: Re: st_dev in struct stat
Date: Sun, 9 Jan 2011 17:16:56 -0800

Yes, it's allowed. All names beginning with st_* are reserved if you include the relevant header files. rdfind has no business using such names.

Thomas


On Sun, Jan 9, 2011 at 4:11 PM, Pino Toscano <toscano.pino@tiscali.it> wrote:
Hi,

just looking at a recent build failure in Debian, "rdfind".
There's some code like:

FileInfo.hh:
 ...
 struct Fileinfostat {
   filesizetype st_size;//size
   unsigned long st_ino;//inode
   unsigned long st_dev;//device
   ...
 };

FileInfo.cc:
 #include "FileInfo.hh"
 ...
 #include <sys/stat.h>
 ...
 struct stat info;
 ...
 instance_of_struct_Fileinfostat.st_dev = info.st_dev;

Such code (a simplified version of which is attached) fails to compile
on Hurd, because in bits/stat.h there is:

struct stat
 {
   ...
   __fsid_t st_fsid;           /* File system ID.  */
#define st_dev  st_fsid

Is this allowed by POSIX (most probly I'm missing the right part(s) of
it)?
If not, would a "fix" for the above be swapping member and define, like:

   __fsid_t st_dev;           /* File system ID.  */
#define st_fsid  st_dev

?
Thanks,
--
Pino Toscano


reply via email to

[Prev in Thread] Current Thread [Next in Thread]