The #include changes have now been applied to my source tree, but I'm not so sure about changing loff_t to off_t. With that change, the size of the type may become too small on a 64-bit machine.
Can you explain why you want that line to change, and why it doesn't break anything?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think using off_t instead of the correct loff_t would break 32-bit systems. The kernel always defines loff_t as u64, and the sys_fallocate() syscall needs loff_t for a parameter.
So.. I'll just have hdparm use "unsigned long long" instead, to keep everything happy.
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The #include changes have now been applied to my source tree, but I'm not so sure about changing loff_t to off_t. With that change, the size of the type may become too small on a 64-bit machine.
Can you explain why you want that line to change, and why it doesn't break anything?
Thanks.
Thanks for applying the include changes.
off_t is here 64bit on all systems because _FILE_OFFSET_BITS is set to 64.
musl needs to be asked more directly to define the legacy loff_t.
(off_t is always 64bit on 64bit systems. However on some 32bit systems it might only be 32bit if LFS is not enabled, e.g. via _FILE_OFFSET_BITS.)
I think using off_t instead of the correct loff_t would break 32-bit systems. The kernel always defines loff_t as u64, and the sys_fallocate() syscall needs loff_t for a parameter.
So.. I'll just have hdparm use "unsigned long long" instead, to keep everything happy.
Thanks.
Thanks for fixing this!
Please read http://users.suse.com/~aj/linux_lfs.html
tl;dr, if _FILE_OFFSET_BITS=64, everything is 64bit on any system.