aboutsummaryrefslogtreecommitdiff
path: root/internal/syscallcompat
diff options
context:
space:
mode:
Diffstat (limited to 'internal/syscallcompat')
-rw-r--r--internal/syscallcompat/unix2syscall_darwin.go26
-rw-r--r--internal/syscallcompat/unix2syscall_linux.go (renamed from internal/syscallcompat/unix2syscall.go)0
2 files changed, 26 insertions, 0 deletions
diff --git a/internal/syscallcompat/unix2syscall_darwin.go b/internal/syscallcompat/unix2syscall_darwin.go
new file mode 100644
index 0000000..93d0ab3
--- /dev/null
+++ b/internal/syscallcompat/unix2syscall_darwin.go
@@ -0,0 +1,26 @@
+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,
+ Atimespec: syscall.Timespec(u.Atimespec),
+ Mtimespec: syscall.Timespec(u.Mtimespec),
+ Ctimespec: syscall.Timespec(u.Ctimespec),
+ }
+}
diff --git a/internal/syscallcompat/unix2syscall.go b/internal/syscallcompat/unix2syscall_linux.go
index 3162025..3162025 100644
--- a/internal/syscallcompat/unix2syscall.go
+++ b/internal/syscallcompat/unix2syscall_linux.go