2017-12-06 00:18:38 +01:00
|
|
|
package syscallcompat
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
|
|
|
|
"golang.org/x/sys/unix"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Unix2syscall converts a unix.Stat_t struct to a syscall.Stat_t struct.
|
|
|
|
func Unix2syscall(u unix.Stat_t) syscall.Stat_t {
|
|
|
|
return syscall.Stat_t{
|
|
|
|
Dev: u.Dev,
|
|
|
|
Ino: u.Ino,
|
|
|
|
Nlink: u.Nlink,
|
|
|
|
Mode: u.Mode,
|
|
|
|
Uid: u.Uid,
|
|
|
|
Gid: u.Gid,
|
|
|
|
Rdev: u.Rdev,
|
|
|
|
Size: u.Size,
|
|
|
|
Blksize: u.Blksize,
|
|
|
|
Blocks: u.Blocks,
|
2019-05-19 21:02:07 +02:00
|
|
|
Atimespec: syscall.Timespec(u.Atim),
|
|
|
|
Mtimespec: syscall.Timespec(u.Mtim),
|
|
|
|
Ctimespec: syscall.Timespec(u.Ctim),
|
2017-12-06 00:18:38 +01:00
|
|
|
}
|
|
|
|
}
|