diff options
author | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
---|---|---|
committer | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
commit | 107c1cdb09c575aa2f61d97f48d8587eb6bada4c (patch) | |
tree | ca7d008643efc555c388baeaf1d986e0b6b3e28c /vendor/golang.org/x/sys/unix/syscall_darwin.go | |
parent | 844b5a68d8af4791755b8f0ad293cc99f5959183 (diff) | |
download | terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.gz terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.zst terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.zip |
Upgrade to 0.12
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall_darwin.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/syscall_darwin.go | 80 |
1 files changed, 43 insertions, 37 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 1aabc56..2120091 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go | |||
@@ -108,17 +108,8 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) ( | |||
108 | return nil, err | 108 | return nil, err |
109 | } | 109 | } |
110 | 110 | ||
111 | _, _, e1 := Syscall6( | 111 | if err := getattrlist(_p0, unsafe.Pointer(&attrList), unsafe.Pointer(&attrBuf[0]), uintptr(len(attrBuf)), int(options)); err != nil { |
112 | SYS_GETATTRLIST, | 112 | return nil, err |
113 | uintptr(unsafe.Pointer(_p0)), | ||
114 | uintptr(unsafe.Pointer(&attrList)), | ||
115 | uintptr(unsafe.Pointer(&attrBuf[0])), | ||
116 | uintptr(len(attrBuf)), | ||
117 | uintptr(options), | ||
118 | 0, | ||
119 | ) | ||
120 | if e1 != 0 { | ||
121 | return nil, e1 | ||
122 | } | 113 | } |
123 | size := *(*uint32)(unsafe.Pointer(&attrBuf[0])) | 114 | size := *(*uint32)(unsafe.Pointer(&attrBuf[0])) |
124 | 115 | ||
@@ -151,6 +142,25 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) ( | |||
151 | return | 142 | return |
152 | } | 143 | } |
153 | 144 | ||
145 | //sys getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) | ||
146 | |||
147 | func SysctlClockinfo(name string) (*Clockinfo, error) { | ||
148 | mib, err := sysctlmib(name) | ||
149 | if err != nil { | ||
150 | return nil, err | ||
151 | } | ||
152 | |||
153 | n := uintptr(SizeofClockinfo) | ||
154 | var ci Clockinfo | ||
155 | if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil { | ||
156 | return nil, err | ||
157 | } | ||
158 | if n != SizeofClockinfo { | ||
159 | return nil, EIO | ||
160 | } | ||
161 | return &ci, nil | ||
162 | } | ||
163 | |||
154 | //sysnb pipe() (r int, w int, err error) | 164 | //sysnb pipe() (r int, w int, err error) |
155 | 165 | ||
156 | func Pipe(p []int) (err error) { | 166 | func Pipe(p []int) (err error) { |
@@ -168,12 +178,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { | |||
168 | _p0 = unsafe.Pointer(&buf[0]) | 178 | _p0 = unsafe.Pointer(&buf[0]) |
169 | bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) | 179 | bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) |
170 | } | 180 | } |
171 | r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags)) | 181 | return getfsstat(_p0, bufsize, flags) |
172 | n = int(r0) | ||
173 | if e1 != 0 { | ||
174 | err = e1 | ||
175 | } | ||
176 | return | ||
177 | } | 182 | } |
178 | 183 | ||
179 | func xattrPointer(dest []byte) *byte { | 184 | func xattrPointer(dest []byte) *byte { |
@@ -298,21 +303,16 @@ func setattrlistTimes(path string, times []Timespec, flags int) error { | |||
298 | if flags&AT_SYMLINK_NOFOLLOW != 0 { | 303 | if flags&AT_SYMLINK_NOFOLLOW != 0 { |
299 | options |= FSOPT_NOFOLLOW | 304 | options |= FSOPT_NOFOLLOW |
300 | } | 305 | } |
301 | _, _, e1 := Syscall6( | 306 | return setattrlist( |
302 | SYS_SETATTRLIST, | 307 | _p0, |
303 | uintptr(unsafe.Pointer(_p0)), | 308 | unsafe.Pointer(&attrList), |
304 | uintptr(unsafe.Pointer(&attrList)), | 309 | unsafe.Pointer(&attributes), |
305 | uintptr(unsafe.Pointer(&attributes)), | 310 | unsafe.Sizeof(attributes), |
306 | uintptr(unsafe.Sizeof(attributes)), | 311 | options) |
307 | uintptr(options), | ||
308 | 0, | ||
309 | ) | ||
310 | if e1 != 0 { | ||
311 | return e1 | ||
312 | } | ||
313 | return nil | ||
314 | } | 312 | } |
315 | 313 | ||
314 | //sys setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) | ||
315 | |||
316 | func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error { | 316 | func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error { |
317 | // Darwin doesn't support SYS_UTIMENSAT | 317 | // Darwin doesn't support SYS_UTIMENSAT |
318 | return ENOSYS | 318 | return ENOSYS |
@@ -411,6 +411,18 @@ func Uname(uname *Utsname) error { | |||
411 | return nil | 411 | return nil |
412 | } | 412 | } |
413 | 413 | ||
414 | func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { | ||
415 | if raceenabled { | ||
416 | raceReleaseMerge(unsafe.Pointer(&ioSync)) | ||
417 | } | ||
418 | var length = int64(count) | ||
419 | err = sendfile(infd, outfd, *offset, &length, nil, 0) | ||
420 | written = int(length) | ||
421 | return | ||
422 | } | ||
423 | |||
424 | //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) | ||
425 | |||
414 | /* | 426 | /* |
415 | * Exposed directly | 427 | * Exposed directly |
416 | */ | 428 | */ |
@@ -421,6 +433,7 @@ func Uname(uname *Utsname) error { | |||
421 | //sys Chmod(path string, mode uint32) (err error) | 433 | //sys Chmod(path string, mode uint32) (err error) |
422 | //sys Chown(path string, uid int, gid int) (err error) | 434 | //sys Chown(path string, uid int, gid int) (err error) |
423 | //sys Chroot(path string) (err error) | 435 | //sys Chroot(path string) (err error) |
436 | //sys ClockGettime(clockid int32, time *Timespec) (err error) | ||
424 | //sys Close(fd int) (err error) | 437 | //sys Close(fd int) (err error) |
425 | //sys Dup(fd int) (nfd int, err error) | 438 | //sys Dup(fd int) (nfd int, err error) |
426 | //sys Dup2(from int, to int) (err error) | 439 | //sys Dup2(from int, to int) (err error) |
@@ -435,12 +448,8 @@ func Uname(uname *Utsname) error { | |||
435 | //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) | 448 | //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) |
436 | //sys Flock(fd int, how int) (err error) | 449 | //sys Flock(fd int, how int) (err error) |
437 | //sys Fpathconf(fd int, name int) (val int, err error) | 450 | //sys Fpathconf(fd int, name int) (val int, err error) |
438 | //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 | ||
439 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 | ||
440 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 | ||
441 | //sys Fsync(fd int) (err error) | 451 | //sys Fsync(fd int) (err error) |
442 | //sys Ftruncate(fd int, length int64) (err error) | 452 | //sys Ftruncate(fd int, length int64) (err error) |
443 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 | ||
444 | //sys Getdtablesize() (size int) | 453 | //sys Getdtablesize() (size int) |
445 | //sysnb Getegid() (egid int) | 454 | //sysnb Getegid() (egid int) |
446 | //sysnb Geteuid() (uid int) | 455 | //sysnb Geteuid() (uid int) |
@@ -460,7 +469,6 @@ func Uname(uname *Utsname) error { | |||
460 | //sys Link(path string, link string) (err error) | 469 | //sys Link(path string, link string) (err error) |
461 | //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) | 470 | //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) |
462 | //sys Listen(s int, backlog int) (err error) | 471 | //sys Listen(s int, backlog int) (err error) |
463 | //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 | ||
464 | //sys Mkdir(path string, mode uint32) (err error) | 472 | //sys Mkdir(path string, mode uint32) (err error) |
465 | //sys Mkdirat(dirfd int, path string, mode uint32) (err error) | 473 | //sys Mkdirat(dirfd int, path string, mode uint32) (err error) |
466 | //sys Mkfifo(path string, mode uint32) (err error) | 474 | //sys Mkfifo(path string, mode uint32) (err error) |
@@ -492,8 +500,6 @@ func Uname(uname *Utsname) error { | |||
492 | //sysnb Setsid() (pid int, err error) | 500 | //sysnb Setsid() (pid int, err error) |
493 | //sysnb Settimeofday(tp *Timeval) (err error) | 501 | //sysnb Settimeofday(tp *Timeval) (err error) |
494 | //sysnb Setuid(uid int) (err error) | 502 | //sysnb Setuid(uid int) (err error) |
495 | //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 | ||
496 | //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 | ||
497 | //sys Symlink(path string, link string) (err error) | 503 | //sys Symlink(path string, link string) (err error) |
498 | //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) | 504 | //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) |
499 | //sys Sync() (err error) | 505 | //sys Sync() (err error) |