Source file
src/syscall/syscall_linux_arm64.go
1
2
3
4
5 package syscall
6
7 import "unsafe"
8
9 const (
10 _SYS_setgroups = SYS_SETGROUPS
11 _SYS_clone3 = 435
12 _SYS_faccessat2 = 439
13 _SYS_fchmodat2 = 452
14 )
15
16
17
18
19
20
21 func Fstatat(fd int, path string, stat *Stat_t, flags int) error {
22 return fstatat(fd, path, stat, flags)
23 }
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 func Stat(path string, stat *Stat_t) (err error) {
43 return fstatat(_AT_FDCWD, path, stat, 0)
44 }
45
46 func Lchown(path string, uid int, gid int) (err error) {
47 return Fchownat(_AT_FDCWD, path, uid, gid, _AT_SYMLINK_NOFOLLOW)
48 }
49
50 func Lstat(path string, stat *Stat_t) (err error) {
51 return fstatat(_AT_FDCWD, path, stat, _AT_SYMLINK_NOFOLLOW)
52 }
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73 type sigset_t struct {
74 X__val [16]uint64
75 }
76
77
78
79 func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
80 var ts *Timespec
81 if timeout != nil {
82 ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
83 }
84 return pselect(nfd, r, w, e, ts, nil)
85 }
86
87
88
89 func setTimespec(sec, nsec int64) Timespec {
90 return Timespec{Sec: sec, Nsec: nsec}
91 }
92
93 func setTimeval(sec, usec int64) Timeval {
94 return Timeval{Sec: sec, Usec: usec}
95 }
96
97 func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) {
98 if tv == nil {
99 return utimensat(dirfd, path, nil, 0)
100 }
101
102 ts := []Timespec{
103 NsecToTimespec(TimevalToNsec(tv[0])),
104 NsecToTimespec(TimevalToNsec(tv[1])),
105 }
106 return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
107 }
108
109 func Time(t *Time_t) (Time_t, error) {
110 var tv Timeval
111 err := Gettimeofday(&tv)
112 if err != nil {
113 return 0, err
114 }
115 if t != nil {
116 *t = Time_t(tv.Sec)
117 }
118 return Time_t(tv.Sec), nil
119 }
120
121 func Utime(path string, buf *Utimbuf) error {
122 tv := []Timeval{
123 {Sec: buf.Actime},
124 {Sec: buf.Modtime},
125 }
126 return Utimes(path, tv)
127 }
128
129 func utimes(path string, tv *[2]Timeval) (err error) {
130 if tv == nil {
131 return utimensat(_AT_FDCWD, path, nil, 0)
132 }
133
134 ts := []Timespec{
135 NsecToTimespec(TimevalToNsec(tv[0])),
136 NsecToTimespec(TimevalToNsec(tv[1])),
137 }
138 return utimensat(_AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
139 }
140
141 func (r *PtraceRegs) PC() uint64 { return r.Pc }
142
143 func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }
144
145 func (iov *Iovec) SetLen(length int) {
146 iov.Len = uint64(length)
147 }
148
149 func (msghdr *Msghdr) SetControllen(length int) {
150 msghdr.Controllen = uint64(length)
151 }
152
153 func (cmsg *Cmsghdr) SetLen(length int) {
154 cmsg.Len = uint64(length)
155 }
156
157 func InotifyInit() (fd int, err error) {
158 return InotifyInit1(0)
159 }
160
161
162
163 func Pause() error {
164 _, err := ppoll(nil, 0, nil, nil)
165 return err
166 }
167
View as plain text