diff options
author | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
---|---|---|
committer | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
commit | 15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (patch) | |
tree | 255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/golang.org/x/sys/unix/syscall_freebsd.go | |
parent | 07971ca38143c5faf951d152fba370ddcbe26ad5 (diff) | |
download | terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.gz terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.zst terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.zip |
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
Updated via: go get github.com/hashicorp/terraform@sdk-v0.11-with-go-modules and go mod tidy
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall_freebsd.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/syscall_freebsd.go | 817 |
1 files changed, 817 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go new file mode 100644 index 0000000..085a808 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go | |||
@@ -0,0 +1,817 @@ | |||
1 | // Copyright 2009,2010 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // FreeBSD system calls. | ||
6 | // This file is compiled as ordinary Go code, | ||
7 | // but it is also input to mksyscall, | ||
8 | // which parses the //sys lines and generates system call stubs. | ||
9 | // Note that sometimes we use a lowercase //sys name and wrap | ||
10 | // it in our own nicer implementation, either here or in | ||
11 | // syscall_bsd.go or syscall_unix.go. | ||
12 | |||
13 | package unix | ||
14 | |||
15 | import ( | ||
16 | "sync" | ||
17 | "unsafe" | ||
18 | ) | ||
19 | |||
20 | const ( | ||
21 | SYS_FSTAT_FREEBSD12 = 551 // { int fstat(int fd, _Out_ struct stat *sb); } | ||
22 | SYS_FSTATAT_FREEBSD12 = 552 // { int fstatat(int fd, _In_z_ char *path, \ | ||
23 | SYS_GETDIRENTRIES_FREEBSD12 = 554 // { ssize_t getdirentries(int fd, \ | ||
24 | SYS_STATFS_FREEBSD12 = 555 // { int statfs(_In_z_ char *path, \ | ||
25 | SYS_FSTATFS_FREEBSD12 = 556 // { int fstatfs(int fd, \ | ||
26 | SYS_GETFSSTAT_FREEBSD12 = 557 // { int getfsstat( \ | ||
27 | SYS_MKNODAT_FREEBSD12 = 559 // { int mknodat(int fd, _In_z_ char *path, \ | ||
28 | ) | ||
29 | |||
30 | // See https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/versions.html. | ||
31 | var ( | ||
32 | osreldateOnce sync.Once | ||
33 | osreldate uint32 | ||
34 | ) | ||
35 | |||
36 | // INO64_FIRST from /usr/src/lib/libc/sys/compat-ino64.h | ||
37 | const _ino64First = 1200031 | ||
38 | |||
39 | func supportsABI(ver uint32) bool { | ||
40 | osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") }) | ||
41 | return osreldate >= ver | ||
42 | } | ||
43 | |||
44 | // SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. | ||
45 | type SockaddrDatalink struct { | ||
46 | Len uint8 | ||
47 | Family uint8 | ||
48 | Index uint16 | ||
49 | Type uint8 | ||
50 | Nlen uint8 | ||
51 | Alen uint8 | ||
52 | Slen uint8 | ||
53 | Data [46]int8 | ||
54 | raw RawSockaddrDatalink | ||
55 | } | ||
56 | |||
57 | // Translate "kern.hostname" to []_C_int{0,1,2,3}. | ||
58 | func nametomib(name string) (mib []_C_int, err error) { | ||
59 | const siz = unsafe.Sizeof(mib[0]) | ||
60 | |||
61 | // NOTE(rsc): It seems strange to set the buffer to have | ||
62 | // size CTL_MAXNAME+2 but use only CTL_MAXNAME | ||
63 | // as the size. I don't know why the +2 is here, but the | ||
64 | // kernel uses +2 for its own implementation of this function. | ||
65 | // I am scared that if we don't include the +2 here, the kernel | ||
66 | // will silently write 2 words farther than we specify | ||
67 | // and we'll get memory corruption. | ||
68 | var buf [CTL_MAXNAME + 2]_C_int | ||
69 | n := uintptr(CTL_MAXNAME) * siz | ||
70 | |||
71 | p := (*byte)(unsafe.Pointer(&buf[0])) | ||
72 | bytes, err := ByteSliceFromString(name) | ||
73 | if err != nil { | ||
74 | return nil, err | ||
75 | } | ||
76 | |||
77 | // Magic sysctl: "setting" 0.3 to a string name | ||
78 | // lets you read back the array of integers form. | ||
79 | if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil { | ||
80 | return nil, err | ||
81 | } | ||
82 | return buf[0 : n/siz], nil | ||
83 | } | ||
84 | |||
85 | func Pipe(p []int) (err error) { | ||
86 | return Pipe2(p, 0) | ||
87 | } | ||
88 | |||
89 | //sysnb pipe2(p *[2]_C_int, flags int) (err error) | ||
90 | |||
91 | func Pipe2(p []int, flags int) error { | ||
92 | if len(p) != 2 { | ||
93 | return EINVAL | ||
94 | } | ||
95 | var pp [2]_C_int | ||
96 | err := pipe2(&pp, flags) | ||
97 | p[0] = int(pp[0]) | ||
98 | p[1] = int(pp[1]) | ||
99 | return err | ||
100 | } | ||
101 | |||
102 | func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) { | ||
103 | var value IPMreqn | ||
104 | vallen := _Socklen(SizeofIPMreqn) | ||
105 | errno := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) | ||
106 | return &value, errno | ||
107 | } | ||
108 | |||
109 | func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) { | ||
110 | return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq)) | ||
111 | } | ||
112 | |||
113 | func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) { | ||
114 | var rsa RawSockaddrAny | ||
115 | var len _Socklen = SizeofSockaddrAny | ||
116 | nfd, err = accept4(fd, &rsa, &len, flags) | ||
117 | if err != nil { | ||
118 | return | ||
119 | } | ||
120 | if len > SizeofSockaddrAny { | ||
121 | panic("RawSockaddrAny too small") | ||
122 | } | ||
123 | sa, err = anyToSockaddr(fd, &rsa) | ||
124 | if err != nil { | ||
125 | Close(nfd) | ||
126 | nfd = 0 | ||
127 | } | ||
128 | return | ||
129 | } | ||
130 | |||
131 | const ImplementsGetwd = true | ||
132 | |||
133 | //sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD | ||
134 | |||
135 | func Getwd() (string, error) { | ||
136 | var buf [PathMax]byte | ||
137 | _, err := Getcwd(buf[0:]) | ||
138 | if err != nil { | ||
139 | return "", err | ||
140 | } | ||
141 | n := clen(buf[:]) | ||
142 | if n < 1 { | ||
143 | return "", EINVAL | ||
144 | } | ||
145 | return string(buf[:n]), nil | ||
146 | } | ||
147 | |||
148 | func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { | ||
149 | var ( | ||
150 | _p0 unsafe.Pointer | ||
151 | bufsize uintptr | ||
152 | oldBuf []statfs_freebsd11_t | ||
153 | needsConvert bool | ||
154 | ) | ||
155 | |||
156 | if len(buf) > 0 { | ||
157 | if supportsABI(_ino64First) { | ||
158 | _p0 = unsafe.Pointer(&buf[0]) | ||
159 | bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) | ||
160 | } else { | ||
161 | n := len(buf) | ||
162 | oldBuf = make([]statfs_freebsd11_t, n) | ||
163 | _p0 = unsafe.Pointer(&oldBuf[0]) | ||
164 | bufsize = unsafe.Sizeof(statfs_freebsd11_t{}) * uintptr(n) | ||
165 | needsConvert = true | ||
166 | } | ||
167 | } | ||
168 | var sysno uintptr = SYS_GETFSSTAT | ||
169 | if supportsABI(_ino64First) { | ||
170 | sysno = SYS_GETFSSTAT_FREEBSD12 | ||
171 | } | ||
172 | r0, _, e1 := Syscall(sysno, uintptr(_p0), bufsize, uintptr(flags)) | ||
173 | n = int(r0) | ||
174 | if e1 != 0 { | ||
175 | err = e1 | ||
176 | } | ||
177 | if e1 == 0 && needsConvert { | ||
178 | for i := range oldBuf { | ||
179 | buf[i].convertFrom(&oldBuf[i]) | ||
180 | } | ||
181 | } | ||
182 | return | ||
183 | } | ||
184 | |||
185 | func setattrlistTimes(path string, times []Timespec, flags int) error { | ||
186 | // used on Darwin for UtimesNano | ||
187 | return ENOSYS | ||
188 | } | ||
189 | |||
190 | //sys ioctl(fd int, req uint, arg uintptr) (err error) | ||
191 | |||
192 | // ioctl itself should not be exposed directly, but additional get/set | ||
193 | // functions for specific types are permissible. | ||
194 | |||
195 | // IoctlSetInt performs an ioctl operation which sets an integer value | ||
196 | // on fd, using the specified request number. | ||
197 | func IoctlSetInt(fd int, req uint, value int) error { | ||
198 | return ioctl(fd, req, uintptr(value)) | ||
199 | } | ||
200 | |||
201 | func ioctlSetWinsize(fd int, req uint, value *Winsize) error { | ||
202 | return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | ||
203 | } | ||
204 | |||
205 | func ioctlSetTermios(fd int, req uint, value *Termios) error { | ||
206 | return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | ||
207 | } | ||
208 | |||
209 | // IoctlGetInt performs an ioctl operation which gets an integer value | ||
210 | // from fd, using the specified request number. | ||
211 | func IoctlGetInt(fd int, req uint) (int, error) { | ||
212 | var value int | ||
213 | err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | ||
214 | return value, err | ||
215 | } | ||
216 | |||
217 | func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { | ||
218 | var value Winsize | ||
219 | err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | ||
220 | return &value, err | ||
221 | } | ||
222 | |||
223 | func IoctlGetTermios(fd int, req uint) (*Termios, error) { | ||
224 | var value Termios | ||
225 | err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | ||
226 | return &value, err | ||
227 | } | ||
228 | |||
229 | func Uname(uname *Utsname) error { | ||
230 | mib := []_C_int{CTL_KERN, KERN_OSTYPE} | ||
231 | n := unsafe.Sizeof(uname.Sysname) | ||
232 | if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil { | ||
233 | return err | ||
234 | } | ||
235 | |||
236 | mib = []_C_int{CTL_KERN, KERN_HOSTNAME} | ||
237 | n = unsafe.Sizeof(uname.Nodename) | ||
238 | if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil { | ||
239 | return err | ||
240 | } | ||
241 | |||
242 | mib = []_C_int{CTL_KERN, KERN_OSRELEASE} | ||
243 | n = unsafe.Sizeof(uname.Release) | ||
244 | if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil { | ||
245 | return err | ||
246 | } | ||
247 | |||
248 | mib = []_C_int{CTL_KERN, KERN_VERSION} | ||
249 | n = unsafe.Sizeof(uname.Version) | ||
250 | if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil { | ||
251 | return err | ||
252 | } | ||
253 | |||
254 | // The version might have newlines or tabs in it, convert them to | ||
255 | // spaces. | ||
256 | for i, b := range uname.Version { | ||
257 | if b == '\n' || b == '\t' { | ||
258 | if i == len(uname.Version)-1 { | ||
259 | uname.Version[i] = 0 | ||
260 | } else { | ||
261 | uname.Version[i] = ' ' | ||
262 | } | ||
263 | } | ||
264 | } | ||
265 | |||
266 | mib = []_C_int{CTL_HW, HW_MACHINE} | ||
267 | n = unsafe.Sizeof(uname.Machine) | ||
268 | if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil { | ||
269 | return err | ||
270 | } | ||
271 | |||
272 | return nil | ||
273 | } | ||
274 | |||
275 | func Stat(path string, st *Stat_t) (err error) { | ||
276 | var oldStat stat_freebsd11_t | ||
277 | if supportsABI(_ino64First) { | ||
278 | return fstatat_freebsd12(AT_FDCWD, path, st, 0) | ||
279 | } | ||
280 | err = stat(path, &oldStat) | ||
281 | if err != nil { | ||
282 | return err | ||
283 | } | ||
284 | |||
285 | st.convertFrom(&oldStat) | ||
286 | return nil | ||
287 | } | ||
288 | |||
289 | func Lstat(path string, st *Stat_t) (err error) { | ||
290 | var oldStat stat_freebsd11_t | ||
291 | if supportsABI(_ino64First) { | ||
292 | return fstatat_freebsd12(AT_FDCWD, path, st, AT_SYMLINK_NOFOLLOW) | ||
293 | } | ||
294 | err = lstat(path, &oldStat) | ||
295 | if err != nil { | ||
296 | return err | ||
297 | } | ||
298 | |||
299 | st.convertFrom(&oldStat) | ||
300 | return nil | ||
301 | } | ||
302 | |||
303 | func Fstat(fd int, st *Stat_t) (err error) { | ||
304 | var oldStat stat_freebsd11_t | ||
305 | if supportsABI(_ino64First) { | ||
306 | return fstat_freebsd12(fd, st) | ||
307 | } | ||
308 | err = fstat(fd, &oldStat) | ||
309 | if err != nil { | ||
310 | return err | ||
311 | } | ||
312 | |||
313 | st.convertFrom(&oldStat) | ||
314 | return nil | ||
315 | } | ||
316 | |||
317 | func Fstatat(fd int, path string, st *Stat_t, flags int) (err error) { | ||
318 | var oldStat stat_freebsd11_t | ||
319 | if supportsABI(_ino64First) { | ||
320 | return fstatat_freebsd12(fd, path, st, flags) | ||
321 | } | ||
322 | err = fstatat(fd, path, &oldStat, flags) | ||
323 | if err != nil { | ||
324 | return err | ||
325 | } | ||
326 | |||
327 | st.convertFrom(&oldStat) | ||
328 | return nil | ||
329 | } | ||
330 | |||
331 | func Statfs(path string, st *Statfs_t) (err error) { | ||
332 | var oldStatfs statfs_freebsd11_t | ||
333 | if supportsABI(_ino64First) { | ||
334 | return statfs_freebsd12(path, st) | ||
335 | } | ||
336 | err = statfs(path, &oldStatfs) | ||
337 | if err != nil { | ||
338 | return err | ||
339 | } | ||
340 | |||
341 | st.convertFrom(&oldStatfs) | ||
342 | return nil | ||
343 | } | ||
344 | |||
345 | func Fstatfs(fd int, st *Statfs_t) (err error) { | ||
346 | var oldStatfs statfs_freebsd11_t | ||
347 | if supportsABI(_ino64First) { | ||
348 | return fstatfs_freebsd12(fd, st) | ||
349 | } | ||
350 | err = fstatfs(fd, &oldStatfs) | ||
351 | if err != nil { | ||
352 | return err | ||
353 | } | ||
354 | |||
355 | st.convertFrom(&oldStatfs) | ||
356 | return nil | ||
357 | } | ||
358 | |||
359 | func Getdents(fd int, buf []byte) (n int, err error) { | ||
360 | return Getdirentries(fd, buf, nil) | ||
361 | } | ||
362 | |||
363 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { | ||
364 | if supportsABI(_ino64First) { | ||
365 | return getdirentries_freebsd12(fd, buf, basep) | ||
366 | } | ||
367 | |||
368 | // The old syscall entries are smaller than the new. Use 1/4 of the original | ||
369 | // buffer size rounded up to DIRBLKSIZ (see /usr/src/lib/libc/sys/getdirentries.c). | ||
370 | oldBufLen := roundup(len(buf)/4, _dirblksiz) | ||
371 | oldBuf := make([]byte, oldBufLen) | ||
372 | n, err = getdirentries(fd, oldBuf, basep) | ||
373 | if err == nil && n > 0 { | ||
374 | n = convertFromDirents11(buf, oldBuf[:n]) | ||
375 | } | ||
376 | return | ||
377 | } | ||
378 | |||
379 | func Mknod(path string, mode uint32, dev uint64) (err error) { | ||
380 | var oldDev int | ||
381 | if supportsABI(_ino64First) { | ||
382 | return mknodat_freebsd12(AT_FDCWD, path, mode, dev) | ||
383 | } | ||
384 | oldDev = int(dev) | ||
385 | return mknod(path, mode, oldDev) | ||
386 | } | ||
387 | |||
388 | func Mknodat(fd int, path string, mode uint32, dev uint64) (err error) { | ||
389 | var oldDev int | ||
390 | if supportsABI(_ino64First) { | ||
391 | return mknodat_freebsd12(fd, path, mode, dev) | ||
392 | } | ||
393 | oldDev = int(dev) | ||
394 | return mknodat(fd, path, mode, oldDev) | ||
395 | } | ||
396 | |||
397 | // round x to the nearest multiple of y, larger or equal to x. | ||
398 | // | ||
399 | // from /usr/include/sys/param.h Macros for counting and rounding. | ||
400 | // #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) | ||
401 | func roundup(x, y int) int { | ||
402 | return ((x + y - 1) / y) * y | ||
403 | } | ||
404 | |||
405 | func (s *Stat_t) convertFrom(old *stat_freebsd11_t) { | ||
406 | *s = Stat_t{ | ||
407 | Dev: uint64(old.Dev), | ||
408 | Ino: uint64(old.Ino), | ||
409 | Nlink: uint64(old.Nlink), | ||
410 | Mode: old.Mode, | ||
411 | Uid: old.Uid, | ||
412 | Gid: old.Gid, | ||
413 | Rdev: uint64(old.Rdev), | ||
414 | Atim: old.Atim, | ||
415 | Mtim: old.Mtim, | ||
416 | Ctim: old.Ctim, | ||
417 | Birthtim: old.Birthtim, | ||
418 | Size: old.Size, | ||
419 | Blocks: old.Blocks, | ||
420 | Blksize: old.Blksize, | ||
421 | Flags: old.Flags, | ||
422 | Gen: uint64(old.Gen), | ||
423 | } | ||
424 | } | ||
425 | |||
426 | func (s *Statfs_t) convertFrom(old *statfs_freebsd11_t) { | ||
427 | *s = Statfs_t{ | ||
428 | Version: _statfsVersion, | ||
429 | Type: old.Type, | ||
430 | Flags: old.Flags, | ||
431 | Bsize: old.Bsize, | ||
432 | Iosize: old.Iosize, | ||
433 | Blocks: old.Blocks, | ||
434 | Bfree: old.Bfree, | ||
435 | Bavail: old.Bavail, | ||
436 | Files: old.Files, | ||
437 | Ffree: old.Ffree, | ||
438 | Syncwrites: old.Syncwrites, | ||
439 | Asyncwrites: old.Asyncwrites, | ||
440 | Syncreads: old.Syncreads, | ||
441 | Asyncreads: old.Asyncreads, | ||
442 | // Spare | ||
443 | Namemax: old.Namemax, | ||
444 | Owner: old.Owner, | ||
445 | Fsid: old.Fsid, | ||
446 | // Charspare | ||
447 | // Fstypename | ||
448 | // Mntfromname | ||
449 | // Mntonname | ||
450 | } | ||
451 | |||
452 | sl := old.Fstypename[:] | ||
453 | n := clen(*(*[]byte)(unsafe.Pointer(&sl))) | ||
454 | copy(s.Fstypename[:], old.Fstypename[:n]) | ||
455 | |||
456 | sl = old.Mntfromname[:] | ||
457 | n = clen(*(*[]byte)(unsafe.Pointer(&sl))) | ||
458 | copy(s.Mntfromname[:], old.Mntfromname[:n]) | ||
459 | |||
460 | sl = old.Mntonname[:] | ||
461 | n = clen(*(*[]byte)(unsafe.Pointer(&sl))) | ||
462 | copy(s.Mntonname[:], old.Mntonname[:n]) | ||
463 | } | ||
464 | |||
465 | func convertFromDirents11(buf []byte, old []byte) int { | ||
466 | const ( | ||
467 | fixedSize = int(unsafe.Offsetof(Dirent{}.Name)) | ||
468 | oldFixedSize = int(unsafe.Offsetof(dirent_freebsd11{}.Name)) | ||
469 | ) | ||
470 | |||
471 | dstPos := 0 | ||
472 | srcPos := 0 | ||
473 | for dstPos+fixedSize < len(buf) && srcPos+oldFixedSize < len(old) { | ||
474 | dstDirent := (*Dirent)(unsafe.Pointer(&buf[dstPos])) | ||
475 | srcDirent := (*dirent_freebsd11)(unsafe.Pointer(&old[srcPos])) | ||
476 | |||
477 | reclen := roundup(fixedSize+int(srcDirent.Namlen)+1, 8) | ||
478 | if dstPos+reclen > len(buf) { | ||
479 | break | ||
480 | } | ||
481 | |||
482 | dstDirent.Fileno = uint64(srcDirent.Fileno) | ||
483 | dstDirent.Off = 0 | ||
484 | dstDirent.Reclen = uint16(reclen) | ||
485 | dstDirent.Type = srcDirent.Type | ||
486 | dstDirent.Pad0 = 0 | ||
487 | dstDirent.Namlen = uint16(srcDirent.Namlen) | ||
488 | dstDirent.Pad1 = 0 | ||
489 | |||
490 | copy(dstDirent.Name[:], srcDirent.Name[:srcDirent.Namlen]) | ||
491 | padding := buf[dstPos+fixedSize+int(dstDirent.Namlen) : dstPos+reclen] | ||
492 | for i := range padding { | ||
493 | padding[i] = 0 | ||
494 | } | ||
495 | |||
496 | dstPos += int(dstDirent.Reclen) | ||
497 | srcPos += int(srcDirent.Reclen) | ||
498 | } | ||
499 | |||
500 | return dstPos | ||
501 | } | ||
502 | |||
503 | /* | ||
504 | * Exposed directly | ||
505 | */ | ||
506 | //sys Access(path string, mode uint32) (err error) | ||
507 | //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error) | ||
508 | //sys CapEnter() (err error) | ||
509 | //sys capRightsGet(version int, fd int, rightsp *CapRights) (err error) = SYS___CAP_RIGHTS_GET | ||
510 | //sys capRightsLimit(fd int, rightsp *CapRights) (err error) | ||
511 | //sys Chdir(path string) (err error) | ||
512 | //sys Chflags(path string, flags int) (err error) | ||
513 | //sys Chmod(path string, mode uint32) (err error) | ||
514 | //sys Chown(path string, uid int, gid int) (err error) | ||
515 | //sys Chroot(path string) (err error) | ||
516 | //sys Close(fd int) (err error) | ||
517 | //sys Dup(fd int) (nfd int, err error) | ||
518 | //sys Dup2(from int, to int) (err error) | ||
519 | //sys Exit(code int) | ||
520 | //sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) | ||
521 | //sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) | ||
522 | //sys ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) | ||
523 | //sys ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) | ||
524 | //sys ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) | ||
525 | //sys ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) | ||
526 | //sys ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) | ||
527 | //sys ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) | ||
528 | //sys ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) | ||
529 | //sys ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) | ||
530 | //sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) | ||
531 | //sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) | ||
532 | //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE | ||
533 | //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) | ||
534 | //sys Fchdir(fd int) (err error) | ||
535 | //sys Fchflags(fd int, flags int) (err error) | ||
536 | //sys Fchmod(fd int, mode uint32) (err error) | ||
537 | //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) | ||
538 | //sys Fchown(fd int, uid int, gid int) (err error) | ||
539 | //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) | ||
540 | //sys Flock(fd int, how int) (err error) | ||
541 | //sys Fpathconf(fd int, name int) (val int, err error) | ||
542 | //sys fstat(fd int, stat *stat_freebsd11_t) (err error) | ||
543 | //sys fstat_freebsd12(fd int, stat *Stat_t) (err error) | ||
544 | //sys fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error) | ||
545 | //sys fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error) | ||
546 | //sys fstatfs(fd int, stat *statfs_freebsd11_t) (err error) | ||
547 | //sys fstatfs_freebsd12(fd int, stat *Statfs_t) (err error) | ||
548 | //sys Fsync(fd int) (err error) | ||
549 | //sys Ftruncate(fd int, length int64) (err error) | ||
550 | //sys getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) | ||
551 | //sys getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) | ||
552 | //sys Getdtablesize() (size int) | ||
553 | //sysnb Getegid() (egid int) | ||
554 | //sysnb Geteuid() (uid int) | ||
555 | //sysnb Getgid() (gid int) | ||
556 | //sysnb Getpgid(pid int) (pgid int, err error) | ||
557 | //sysnb Getpgrp() (pgrp int) | ||
558 | //sysnb Getpid() (pid int) | ||
559 | //sysnb Getppid() (ppid int) | ||
560 | //sys Getpriority(which int, who int) (prio int, err error) | ||
561 | //sysnb Getrlimit(which int, lim *Rlimit) (err error) | ||
562 | //sysnb Getrusage(who int, rusage *Rusage) (err error) | ||
563 | //sysnb Getsid(pid int) (sid int, err error) | ||
564 | //sysnb Gettimeofday(tv *Timeval) (err error) | ||
565 | //sysnb Getuid() (uid int) | ||
566 | //sys Issetugid() (tainted bool) | ||
567 | //sys Kill(pid int, signum syscall.Signal) (err error) | ||
568 | //sys Kqueue() (fd int, err error) | ||
569 | //sys Lchown(path string, uid int, gid int) (err error) | ||
570 | //sys Link(path string, link string) (err error) | ||
571 | //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) | ||
572 | //sys Listen(s int, backlog int) (err error) | ||
573 | //sys lstat(path string, stat *stat_freebsd11_t) (err error) | ||
574 | //sys Mkdir(path string, mode uint32) (err error) | ||
575 | //sys Mkdirat(dirfd int, path string, mode uint32) (err error) | ||
576 | //sys Mkfifo(path string, mode uint32) (err error) | ||
577 | //sys mknod(path string, mode uint32, dev int) (err error) | ||
578 | //sys mknodat(fd int, path string, mode uint32, dev int) (err error) | ||
579 | //sys mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error) | ||
580 | //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) | ||
581 | //sys Open(path string, mode int, perm uint32) (fd int, err error) | ||
582 | //sys Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) | ||
583 | //sys Pathconf(path string, name int) (val int, err error) | ||
584 | //sys Pread(fd int, p []byte, offset int64) (n int, err error) | ||
585 | //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) | ||
586 | //sys read(fd int, p []byte) (n int, err error) | ||
587 | //sys Readlink(path string, buf []byte) (n int, err error) | ||
588 | //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error) | ||
589 | //sys Rename(from string, to string) (err error) | ||
590 | //sys Renameat(fromfd int, from string, tofd int, to string) (err error) | ||
591 | //sys Revoke(path string) (err error) | ||
592 | //sys Rmdir(path string) (err error) | ||
593 | //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK | ||
594 | //sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) | ||
595 | //sysnb Setegid(egid int) (err error) | ||
596 | //sysnb Seteuid(euid int) (err error) | ||
597 | //sysnb Setgid(gid int) (err error) | ||
598 | //sys Setlogin(name string) (err error) | ||
599 | //sysnb Setpgid(pid int, pgid int) (err error) | ||
600 | //sys Setpriority(which int, who int, prio int) (err error) | ||
601 | //sysnb Setregid(rgid int, egid int) (err error) | ||
602 | //sysnb Setreuid(ruid int, euid int) (err error) | ||
603 | //sysnb Setresgid(rgid int, egid int, sgid int) (err error) | ||
604 | //sysnb Setresuid(ruid int, euid int, suid int) (err error) | ||
605 | //sysnb Setrlimit(which int, lim *Rlimit) (err error) | ||
606 | //sysnb Setsid() (pid int, err error) | ||
607 | //sysnb Settimeofday(tp *Timeval) (err error) | ||
608 | //sysnb Setuid(uid int) (err error) | ||
609 | //sys stat(path string, stat *stat_freebsd11_t) (err error) | ||
610 | //sys statfs(path string, stat *statfs_freebsd11_t) (err error) | ||
611 | //sys statfs_freebsd12(path string, stat *Statfs_t) (err error) | ||
612 | //sys Symlink(path string, link string) (err error) | ||
613 | //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) | ||
614 | //sys Sync() (err error) | ||
615 | //sys Truncate(path string, length int64) (err error) | ||
616 | //sys Umask(newmask int) (oldmask int) | ||
617 | //sys Undelete(path string) (err error) | ||
618 | //sys Unlink(path string) (err error) | ||
619 | //sys Unlinkat(dirfd int, path string, flags int) (err error) | ||
620 | //sys Unmount(path string, flags int) (err error) | ||
621 | //sys write(fd int, p []byte) (n int, err error) | ||
622 | //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) | ||
623 | //sys munmap(addr uintptr, length uintptr) (err error) | ||
624 | //sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ | ||
625 | //sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE | ||
626 | //sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) | ||
627 | //sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) | ||
628 | |||
629 | /* | ||
630 | * Unimplemented | ||
631 | */ | ||
632 | // Profil | ||
633 | // Sigaction | ||
634 | // Sigprocmask | ||
635 | // Getlogin | ||
636 | // Sigpending | ||
637 | // Sigaltstack | ||
638 | // Ioctl | ||
639 | // Reboot | ||
640 | // Execve | ||
641 | // Vfork | ||
642 | // Sbrk | ||
643 | // Sstk | ||
644 | // Ovadvise | ||
645 | // Mincore | ||
646 | // Setitimer | ||
647 | // Swapon | ||
648 | // Select | ||
649 | // Sigsuspend | ||
650 | // Readv | ||
651 | // Writev | ||
652 | // Nfssvc | ||
653 | // Getfh | ||
654 | // Quotactl | ||
655 | // Mount | ||
656 | // Csops | ||
657 | // Waitid | ||
658 | // Add_profil | ||
659 | // Kdebug_trace | ||
660 | // Sigreturn | ||
661 | // Atsocket | ||
662 | // Kqueue_from_portset_np | ||
663 | // Kqueue_portset | ||
664 | // Getattrlist | ||
665 | // Setattrlist | ||
666 | // Getdents | ||
667 | // Getdirentriesattr | ||
668 | // Searchfs | ||
669 | // Delete | ||
670 | // Copyfile | ||
671 | // Watchevent | ||
672 | // Waitevent | ||
673 | // Modwatch | ||
674 | // Fsctl | ||
675 | // Initgroups | ||
676 | // Posix_spawn | ||
677 | // Nfsclnt | ||
678 | // Fhopen | ||
679 | // Minherit | ||
680 | // Semsys | ||
681 | // Msgsys | ||
682 | // Shmsys | ||
683 | // Semctl | ||
684 | // Semget | ||
685 | // Semop | ||
686 | // Msgctl | ||
687 | // Msgget | ||
688 | // Msgsnd | ||
689 | // Msgrcv | ||
690 | // Shmat | ||
691 | // Shmctl | ||
692 | // Shmdt | ||
693 | // Shmget | ||
694 | // Shm_open | ||
695 | // Shm_unlink | ||
696 | // Sem_open | ||
697 | // Sem_close | ||
698 | // Sem_unlink | ||
699 | // Sem_wait | ||
700 | // Sem_trywait | ||
701 | // Sem_post | ||
702 | // Sem_getvalue | ||
703 | // Sem_init | ||
704 | // Sem_destroy | ||
705 | // Open_extended | ||
706 | // Umask_extended | ||
707 | // Stat_extended | ||
708 | // Lstat_extended | ||
709 | // Fstat_extended | ||
710 | // Chmod_extended | ||
711 | // Fchmod_extended | ||
712 | // Access_extended | ||
713 | // Settid | ||
714 | // Gettid | ||
715 | // Setsgroups | ||
716 | // Getsgroups | ||
717 | // Setwgroups | ||
718 | // Getwgroups | ||
719 | // Mkfifo_extended | ||
720 | // Mkdir_extended | ||
721 | // Identitysvc | ||
722 | // Shared_region_check_np | ||
723 | // Shared_region_map_np | ||
724 | // __pthread_mutex_destroy | ||
725 | // __pthread_mutex_init | ||
726 | // __pthread_mutex_lock | ||
727 | // __pthread_mutex_trylock | ||
728 | // __pthread_mutex_unlock | ||
729 | // __pthread_cond_init | ||
730 | // __pthread_cond_destroy | ||
731 | // __pthread_cond_broadcast | ||
732 | // __pthread_cond_signal | ||
733 | // Setsid_with_pid | ||
734 | // __pthread_cond_timedwait | ||
735 | // Aio_fsync | ||
736 | // Aio_return | ||
737 | // Aio_suspend | ||
738 | // Aio_cancel | ||
739 | // Aio_error | ||
740 | // Aio_read | ||
741 | // Aio_write | ||
742 | // Lio_listio | ||
743 | // __pthread_cond_wait | ||
744 | // Iopolicysys | ||
745 | // __pthread_kill | ||
746 | // __pthread_sigmask | ||
747 | // __sigwait | ||
748 | // __disable_threadsignal | ||
749 | // __pthread_markcancel | ||
750 | // __pthread_canceled | ||
751 | // __semwait_signal | ||
752 | // Proc_info | ||
753 | // Stat64_extended | ||
754 | // Lstat64_extended | ||
755 | // Fstat64_extended | ||
756 | // __pthread_chdir | ||
757 | // __pthread_fchdir | ||
758 | // Audit | ||
759 | // Auditon | ||
760 | // Getauid | ||
761 | // Setauid | ||
762 | // Getaudit | ||
763 | // Setaudit | ||
764 | // Getaudit_addr | ||
765 | // Setaudit_addr | ||
766 | // Auditctl | ||
767 | // Bsdthread_create | ||
768 | // Bsdthread_terminate | ||
769 | // Stack_snapshot | ||
770 | // Bsdthread_register | ||
771 | // Workq_open | ||
772 | // Workq_ops | ||
773 | // __mac_execve | ||
774 | // __mac_syscall | ||
775 | // __mac_get_file | ||
776 | // __mac_set_file | ||
777 | // __mac_get_link | ||
778 | // __mac_set_link | ||
779 | // __mac_get_proc | ||
780 | // __mac_set_proc | ||
781 | // __mac_get_fd | ||
782 | // __mac_set_fd | ||
783 | // __mac_get_pid | ||
784 | // __mac_get_lcid | ||
785 | // __mac_get_lctx | ||
786 | // __mac_set_lctx | ||
787 | // Setlcid | ||
788 | // Read_nocancel | ||
789 | // Write_nocancel | ||
790 | // Open_nocancel | ||
791 | // Close_nocancel | ||
792 | // Wait4_nocancel | ||
793 | // Recvmsg_nocancel | ||
794 | // Sendmsg_nocancel | ||
795 | // Recvfrom_nocancel | ||
796 | // Accept_nocancel | ||
797 | // Fcntl_nocancel | ||
798 | // Select_nocancel | ||
799 | // Fsync_nocancel | ||
800 | // Connect_nocancel | ||
801 | // Sigsuspend_nocancel | ||
802 | // Readv_nocancel | ||
803 | // Writev_nocancel | ||
804 | // Sendto_nocancel | ||
805 | // Pread_nocancel | ||
806 | // Pwrite_nocancel | ||
807 | // Waitid_nocancel | ||
808 | // Poll_nocancel | ||
809 | // Msgsnd_nocancel | ||
810 | // Msgrcv_nocancel | ||
811 | // Sem_wait_nocancel | ||
812 | // Aio_suspend_nocancel | ||
813 | // __sigwait_nocancel | ||
814 | // __semwait_signal_nocancel | ||
815 | // __mac_mount | ||
816 | // __mac_get_mount | ||
817 | // __mac_getfsstat | ||