github.com/mckael/restic@v0.8.3/internal/restic/node_unix.go (about)

     1  // +build dragonfly linux netbsd openbsd freebsd solaris darwin
     2  
     3  package restic
     4  
     5  import (
     6  	"os"
     7  	"syscall"
     8  )
     9  
    10  var mknod = syscall.Mknod
    11  var lchown = os.Lchown
    12  
    13  type statUnix syscall.Stat_t
    14  
    15  func toStatT(i interface{}) (statT, bool) {
    16  	if i == nil {
    17  		return nil, false
    18  	}
    19  	s, ok := i.(*syscall.Stat_t)
    20  	if ok && s != nil {
    21  		return statUnix(*s), true
    22  	}
    23  	return nil, false
    24  }
    25  
    26  func (s statUnix) dev() uint64   { return uint64(s.Dev) }
    27  func (s statUnix) ino() uint64   { return uint64(s.Ino) }
    28  func (s statUnix) nlink() uint64 { return uint64(s.Nlink) }
    29  func (s statUnix) uid() uint32   { return uint32(s.Uid) }
    30  func (s statUnix) gid() uint32   { return uint32(s.Gid) }
    31  func (s statUnix) rdev() uint64  { return uint64(s.Rdev) }
    32  func (s statUnix) size() int64   { return int64(s.Size) }