2017-07-11 35 views

回答

0

通過使用vfs_stat()vfs_fstatHow do you get the size of a file in the linux kernel?

+0

謝謝回答,我用vfs_stat()。現在我從struct kstat中獲得「大小」。似乎它是loff_t(long long)類型。 因此,例如,用%lld打印值,我看到「/ bin/ls」:-131941060952272。 這是不可能的。我究竟做錯了什麼? – user3376554

+0

檢查你的參數是否正確,並且沒有'vfs_stat()設置的錯誤' – Vishal

+0

在https://stackoverflow.com/questions/19195560/whats-wrong-with-vfs-stat-call上已經存在一個例子,你應在http://www.linuxjournal.com/node/8110/print – Vishal

相關問題