syscall_aix_gccgo.go 745 B

123456789101112131415161718192021222324252627
  1. // Copyright 2020 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. // Recreate a getsystemcfg syscall handler instead of
  5. // using the one provided by x/sys/unix to avoid having
  6. // the dependency between them. (See golang.org/issue/32102)
  7. // Morever, this file will be used during the building of
  8. // gccgo's libgo and thus must not used a CGo method.
  9. //go:build aix && gccgo
  10. // +build aix,gccgo
  11. package cpu
  12. import (
  13. "syscall"
  14. )
  15. //extern getsystemcfg
  16. func gccgoGetsystemcfg(label uint32) (r uint64)
  17. func callgetsystemcfg(label int) (r1 uintptr, e1 syscall.Errno) {
  18. r1 = uintptr(gccgoGetsystemcfg(uint32(label)))
  19. e1 = syscall.GetErrno()
  20. return
  21. }