-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StructStatvfs seems to not be working #36
Comments
Hey, sorry but seems like I was reading wrong the addresses (they were in hex hehehe). But I actually found the issue and I seemed to fix it! Look at this definitions for fsblkcnt_t and fsfilcnt_t in Mac: typedef unsigned int __darwin_fsblkcnt_t; /* Used by statvfs and fstatvfs */
typedef unsigned int __darwin_fsfilcnt_t; /* Used by statvfs and fstatvfs */ They're actually 4 bytes long! So I changed the code for those types on the Mac and MacFuse switch to use 4 bytes instead and df then worked correctly! case MAC:
case MAC_MACFUSE:
size = 4;
break; Please revise it and tell me if you think it's the real fix. Thanks, Alfonso |
It's quite possible that you're right. I don't have an OS X machine for testing, so all the OS X sizes are based off those in fuse.py. However, I think that if there really were a problem in all the OS X stat structs, some more people would have complained by now (there's other OS X users who have reported issues against |
Alright, so this is the output of
My machine's specification:
And finally the
|
Can you also include the output of the actual The bit about |
Here's the output of the
|
Hi,
I just implemented the statfs following the documentation in the Internet, and everything seems to be set fine, except that wrong values are returned to the caller for some of the fields. Trying to find the root cause, I printed the StructStatvfs, and it looks like this:
If you look carefully at the addresses in f_frsize, f_bfree and f_files, even when their types should be 8, seems like only 2 bytes are used to store them natively (it's just an assumption, I don't know much of JNA), which would explain why I'm getting wrong values for those fields. Could it be a JNA issue?
Btw, I'm using a Mac and OSX Fuse for testing.
Thanks,
Alfonso
The text was updated successfully, but these errors were encountered: