[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
header file mismatch for struct statfs and linux
From: |
Chris Friesen |
Subject: |
header file mismatch for struct statfs and linux |
Date: |
Mon, 11 Nov 2002 12:51:33 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 |
The glibc header file for struct statfs defines the following fields:
__fsblkcnt_t f_blocks;
__fsblkcnt_t f_bfree;
__fsblkcnt_t f_bavail;
where __fsblkcnt_t is defined as:
typedef unsigned int __fsblkcnt_t;
This causes problems since the linux kernel (and "man statfs") defines
these entries as type long. As well, I believe POSIX says that they are
supposed to be longs.
When a statfs() call is made on an nfs-mounted filesystem that is not
currently accessable, linux returns -1 in these three fields. Since
userspace is linked against the glibc headers, this causes the obvious
problem if you check that the result is greater than zero.
Chris
--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: address@hidden
- header file mismatch for struct statfs and linux,
Chris Friesen <=