[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st_dev in struct stat
From: |
Pino Toscano |
Subject: |
st_dev in struct stat |
Date: |
Mon, 10 Jan 2011 01:11:33 +0100 |
User-agent: |
KMail/1.13.5 (Linux/2.6.32-5-amd64; KDE/4.4.5; x86_64; ; ) |
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
stat_st_dev.c
Description: Text Data
signature.asc
Description: This is a digitally signed message part.
- st_dev in struct stat,
Pino Toscano <=