The reconcile package is used for DOM reconcilation in Isomorphic Go web applications.

syscall.go 729B

12345678910111213141516171819202122232425262728
  1. // Copyright 2016 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. // +build darwin dragonfly freebsd netbsd openbsd
  5. package route
  6. import (
  7. "syscall"
  8. "unsafe"
  9. )
  10. var zero uintptr
  11. func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
  12. var p unsafe.Pointer
  13. if len(mib) > 0 {
  14. p = unsafe.Pointer(&mib[0])
  15. } else {
  16. p = unsafe.Pointer(&zero)
  17. }
  18. _, _, errno := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(p), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
  19. if errno != 0 {
  20. return error(errno)
  21. }
  22. return nil
  23. }