2023-03-28 01:05:24 +08:00
|
|
|
//go:build linux
|
2018-02-03 00:19:59 +08:00
|
|
|
// +build linux
|
2016-06-22 11:17:59 +08:00
|
|
|
|
2016-06-13 12:45:13 +08:00
|
|
|
package sftp
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
|
|
|
func statvfsFromStatfst(stat *syscall.Statfs_t) (*StatVFS, error) {
|
|
|
|
return &StatVFS{
|
|
|
|
Bsize: uint64(stat.Bsize),
|
|
|
|
Frsize: uint64(stat.Frsize),
|
|
|
|
Blocks: stat.Blocks,
|
|
|
|
Bfree: stat.Bfree,
|
|
|
|
Bavail: stat.Bavail,
|
|
|
|
Files: stat.Files,
|
|
|
|
Ffree: stat.Ffree,
|
2016-10-01 06:07:58 +08:00
|
|
|
Favail: stat.Ffree, // not sure how to calculate Favail
|
|
|
|
Flag: uint64(stat.Flags), // assuming POSIX?
|
2016-06-13 12:45:13 +08:00
|
|
|
Namemax: uint64(stat.Namelen),
|
|
|
|
}, nil
|
|
|
|
}
|