This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
Re: [Various] struct stat
- To: aj@arthur.rhein-neckar.de
- Subject: Re: [Various] struct stat
- From: "Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de>
- Date: Fri, 12 Mar 1999 11:38:23 +0100
- CC: libc-alpha@cygnus.com
- References: <u8g17bjk01.fsf@arthur.rhein-neckar.de>
> There's a discussion on linux-kernel about glibc's definition of field
> st_dev in struct stat for compilers other than gcc. Perhaps somebody
> likes to comment.
It seems that glibc is in error; Matthew Wilcox' quote clearly
indicates that dev_t should be an arithmetic type.
This apparently relates to FAQ entry 2.4, which suggests to report
such a case as a bug.
The best fix I can see is to define __dev_t as __uint64_t, and to
always define __uint64_t (for __GNUC__, still use
__extension__). Then, if there are bug reports that a certain compiler
used on Linux does not support long long, explicitly fall back to
__u_quad_t for that compiler, perhaps with a #warning.
Regards,
Martin