Source file
src/syscall/exec_solaris_test.go
1
2
3
4
5
6
7 package syscall
8
9 import "unsafe"
10
11
12
13
14
15
16
17 var (
18 libc_Getpgid,
19 libc_Getpgrp libcFunc
20 )
21
22 func Getpgid(pid int) (pgid int, err error) {
23 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Getpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0)
24 pgid = int(r0)
25 if e1 != 0 {
26 err = e1
27 }
28 return
29 }
30
31 func Getpgrp() (pgrp int) {
32 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&libc_Getpgrp)), 0, 0, 0, 0, 0, 0, 0)
33 pgrp = int(r0)
34 return
35 }
36
37 func Tcgetpgrp(fd int) (pgid int32, err error) {
38 if errno := ioctlPtr(uintptr(fd), TIOCGPGRP, unsafe.Pointer(&pgid)); errno != 0 {
39 return -1, errno
40 }
41 return pgid, nil
42 }
43
44 func Tcsetpgrp(fd int, pgid int32) (err error) {
45 return ioctlPtr(uintptr(fd), TIOCSPGRP, unsafe.Pointer(&pgid))
46 }
47
View as plain text