Skip to contentSkip to conversation

strange behaviour with statfs() call, looking for advice

DISCUSSION Chris Friesen 1 participant 2 messages Nov 11, 2002

lore
Share & tools
lore
#0 lore raw

I seem to be getting some strange interactions between kernel space and userspace with the statfs() call.

On an nfs-mounted but unaccessable system, the statfs() call is returning a block count of 4294967295. Since the kernel statfs struct has this field defined as a long and this is a 32-bit system, this is somewhat confusing.

It turns out that the userspace headers define the "blocks" field as a __fsblkcnt_t, which is then defined as __u_long.

What do I do? Do I cast it to a long since I know that this is what the kernel is using?

The system in question is a yellowdog system, but the same problem is present on a recent mandrake box as well. Is this a redhat issue?

Thanks,

Chris

Signature · 4 lines
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: [email protected]
#1 lore raw

Re: strange behaviour with statfs() call, looking for advice -- followup

Quoted 1 line · Friesen, Christopher [CAR:7Q26:EXCH] wrote:

The system in question is a yellowdog system, but the same problem is present on a recent mandrake box as well. Is this a redhat issue?

It appears that this is a glibc problem, and it is still present in the latest glibc. Just a warning to people using statfs().

Chris

Signature · 4 lines
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: [email protected]