github.com/code-reading/golang@v0.0.0-20220303082512-ba5bc0e589a3/go/src/syscall/exec_solaris_test.go (about) 1 // Copyright 2015 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 //go:build solaris 6 // +build solaris 7 8 package syscall 9 10 import "unsafe" 11 12 //go:cgo_import_dynamic libc_Getpgid getpgid "libc.so" 13 //go:cgo_import_dynamic libc_Getpgrp getpgrp "libc.so" 14 15 //go:linkname libc_Getpgid libc_Getpgid 16 //go:linkname libc_Getpgrp libc_Getpgrp 17 18 var ( 19 libc_Getpgid, 20 libc_Getpgrp libcFunc 21 ) 22 23 func Getpgid(pid int) (pgid int, err error) { 24 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Getpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0) 25 pgid = int(r0) 26 if e1 != 0 { 27 err = e1 28 } 29 return 30 } 31 32 func Getpgrp() (pgrp int) { 33 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&libc_Getpgrp)), 0, 0, 0, 0, 0, 0, 0) 34 pgrp = int(r0) 35 return 36 } 37 38 var Ioctl = ioctl