-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Unexpected stat(v)fs struct size on i686 #71
Comments
The following returns nothing inside the build container (probably because the appropriate packages weren't installed), so the following output is from a bare metal machine.
|
I guess Edit: actually, I think that's not the correct solution. |
Could just be that the spec needs to be updated. I feel like this is an arch-specific issue, too. |
That statement seems correct with It definitely evaluates to true.
which means that linux64 should be true, thus we should expect the larger structure.
which makes sense, as the test itself says Running |
Does arch have separate structs, e.g. statfs and statfs64? |
Arch uses glibc which only provides
Without that define you get
I also found out that musl provides 64 bit functions only. I don't know if anyone has tried this gem on a musl system but I suspect there it'll expect the 32 bit variants and fail (since it won't find the |
mkmf-lite only uses whatever's inside |
It doesn't seem to be using |
Please try with mkmf-lite 0.7.0 and let me know how it goes. |
The statfs one passes now, but the statvfs still fails. It looks like the issue is different now (possibly incorrect spec file).
With a similar test program as above: |
I think now we'll need to compare the actual statvfs struct on your system versus what I've got defined in structs.rb. |
Snippet from my bits/statvfs.h #include <bits/types.h> /* For __fsblkcnt_t and __fsfilcnt_t. */
#if (__WORDSIZE == 32 \
&& (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
#define _STATVFSBUF_F_UNUSED
#endif
struct statvfs
{
unsigned long int f_bsize;
unsigned long int f_frsize;
#ifndef __USE_FILE_OFFSET64
__fsblkcnt_t f_blocks;
__fsblkcnt_t f_bfree;
__fsblkcnt_t f_bavail;
__fsfilcnt_t f_files;
__fsfilcnt_t f_ffree;
__fsfilcnt_t f_favail;
#else
__fsblkcnt64_t f_blocks;
__fsblkcnt64_t f_bfree;
__fsblkcnt64_t f_bavail;
__fsfilcnt64_t f_files;
__fsfilcnt64_t f_ffree;
__fsfilcnt64_t f_favail;
#endif
unsigned long int f_fsid;
#ifdef _STATVFSBUF_F_UNUSED
int __f_unused;
#endif
unsigned long int f_flag;
unsigned long int f_namemax;
unsigned int f_type;
int __f_spare[5];
}; If I am reading it correctly, it looks like it's because [0] sys-filesystem/lib/sys/unix/sys/filesystem/structs.rb Lines 229 to 242 in 5253e1d
|
I think this will require a PR. Since it's a one-time check on load it shouldn't be a huge deal. Feel like putting one together? Its probably easier for you to create and test than me since you have the system. |
I'm unsure how this would be implemented. This extra field would need to be added to the linux64 struct. Since I'm not a ruby developer, the only way I can think of doing this is by making a linux32_64 struct that has this extra field inside of it, and picking that instead of the existing linux64 one. Is this what you have in mind? Or is there some other mechanism I can use to modify the struct in a more manageable way? |
Hm, am I missing the
|
I don't think |
The problem is not with In my system's struct, The problem is that on the 64 bit struct under 32 bit systems, there's no Based on the diff above, I was initially going to do |
Your fixes have been merged and included in release 1.5.1 which I've just pushed out. Many thanks for your help and contributions! |
The following two tests fail when running on a 32 bit x86 system.
The text was updated successfully, but these errors were encountered: