File: fuse_kernel_darwin.go

package info (click to toggle)
golang-bazil-fuse 0.0~git20160811.0.371fbbd-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, buster-backports, experimental, sid
  • size: 728 kB
  • sloc: sh: 26; makefile: 5
file content (88 lines) | stat: -rw-r--r-- 1,493 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package fuse

import (
	"time"
)

type attr struct {
	Ino        uint64
	Size       uint64
	Blocks     uint64
	Atime      uint64
	Mtime      uint64
	Ctime      uint64
	Crtime_    uint64 // OS X only
	AtimeNsec  uint32
	MtimeNsec  uint32
	CtimeNsec  uint32
	CrtimeNsec uint32 // OS X only
	Mode       uint32
	Nlink      uint32
	Uid        uint32
	Gid        uint32
	Rdev       uint32
	Flags_     uint32 // OS X only; see chflags(2)
	Blksize    uint32
	padding    uint32
}

func (a *attr) SetCrtime(s uint64, ns uint32) {
	a.Crtime_, a.CrtimeNsec = s, ns
}

func (a *attr) SetFlags(f uint32) {
	a.Flags_ = f
}

type setattrIn struct {
	setattrInCommon

	// OS X only
	Bkuptime_    uint64
	Chgtime_     uint64
	Crtime       uint64
	BkuptimeNsec uint32
	ChgtimeNsec  uint32
	CrtimeNsec   uint32
	Flags_       uint32 // see chflags(2)
}

func (in *setattrIn) BkupTime() time.Time {
	return time.Unix(int64(in.Bkuptime_), int64(in.BkuptimeNsec))
}

func (in *setattrIn) Chgtime() time.Time {
	return time.Unix(int64(in.Chgtime_), int64(in.ChgtimeNsec))
}

func (in *setattrIn) Flags() uint32 {
	return in.Flags_
}

func openFlags(flags uint32) OpenFlags {
	return OpenFlags(flags)
}

type getxattrIn struct {
	getxattrInCommon

	// OS X only
	Position uint32
	Padding  uint32
}

func (g *getxattrIn) position() uint32 {
	return g.Position
}

type setxattrIn struct {
	setxattrInCommon

	// OS X only
	Position uint32
	Padding  uint32
}

func (s *setxattrIn) position() uint32 {
	return s.Position
}