Source file
src/syscall/syscall_linux_arm64.go
1
2
3
4
5 package syscall
6
7 import "unsafe"
8
9 const _SYS_setgroups = SYS_SETGROUPS
10
11 func EpollCreate(size int) (fd int, err error) {
12 if size <= 0 {
13 return -1, EINVAL
14 }
15 return EpollCreate1(0)
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 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
74 type sigset_t struct {
75 X__val [16]uint64
76 }
77
78
79
80 func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
81 var ts *Timespec
82 if timeout != nil {
83 ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
84 }
85 return pselect(nfd, r, w, e, ts, nil)
86 }
87
88
89
90 func setTimespec(sec, nsec int64) Timespec {
91 return Timespec{Sec: sec, Nsec: nsec}
92 }
93
94 func setTimeval(sec, usec int64) Timeval {
95 return Timeval{Sec: sec, Usec: usec}
96 }
97
98 func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) {
99 if tv == nil {
100 return utimensat(dirfd, path, nil, 0)
101 }
102
103 ts := []Timespec{
104 NsecToTimespec(TimevalToNsec(tv[0])),
105 NsecToTimespec(TimevalToNsec(tv[1])),
106 }
107 return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
108 }
109
110 func Time(t *Time_t) (Time_t, error) {
111 var tv Timeval
112 err := Gettimeofday(&tv)
113 if err != nil {
114 return 0, err
115 }
116 if t != nil {
117 *t = Time_t(tv.Sec)
118 }
119 return Time_t(tv.Sec), nil
120 }
121
122 func Utime(path string, buf *Utimbuf) error {
123 tv := []Timeval{
124 {Sec: buf.Actime},
125 {Sec: buf.Modtime},
126 }
127 return Utimes(path, tv)
128 }
129
130 func utimes(path string, tv *[2]Timeval) (err error) {
131 if tv == nil {
132 return utimensat(_AT_FDCWD, path, nil, 0)
133 }
134
135 ts := []Timespec{
136 NsecToTimespec(TimevalToNsec(tv[0])),
137 NsecToTimespec(TimevalToNsec(tv[1])),
138 }
139 return utimensat(_AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
140 }
141
142
143 func Getrlimit(resource int, rlim *Rlimit) error {
144 err := prlimit(0, resource, nil, rlim)
145 if err != ENOSYS {
146 return err
147 }
148 return getrlimit(resource, rlim)
149 }
150
151
152 func Setrlimit(resource int, rlim *Rlimit) error {
153 err := prlimit(0, resource, rlim, nil)
154 if err != ENOSYS {
155 return err
156 }
157 return setrlimit(resource, rlim)
158 }
159
160 func (r *PtraceRegs) PC() uint64 { return r.Pc }
161
162 func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }
163
164 func (iov *Iovec) SetLen(length int) {
165 iov.Len = uint64(length)
166 }
167
168 func (msghdr *Msghdr) SetControllen(length int) {
169 msghdr.Controllen = uint64(length)
170 }
171
172 func (cmsg *Cmsghdr) SetLen(length int) {
173 cmsg.Len = uint64(length)
174 }
175
176 func InotifyInit() (fd int, err error) {
177 return InotifyInit1(0)
178 }
179
180
181
182 func Pause() error {
183 _, err := ppoll(nil, 0, nil, nil)
184 return err
185 }
186
187 func rawVforkSyscall(trap, a1 uintptr) (r1 uintptr, err Errno)
188
View as plain text