gitlab.com/apertussolutions/u-root@v7.0.0+incompatible/cmds/core/elvish/sys/tc.go (about)

     1  // +build !windows,!plan9
     2  
     3  package sys
     4  
     5  import (
     6  	"unsafe"
     7  
     8  	"golang.org/x/sys/unix"
     9  )
    10  
    11  func Tcgetpgrp(fd int) (int, error) {
    12  	var pid int
    13  	errno := Ioctl(fd, unix.TIOCGPGRP, uintptr(unsafe.Pointer(&pid)))
    14  	if errno == nil {
    15  		return pid, nil
    16  	}
    17  	return -1, errno
    18  }
    19  
    20  func Tcsetpgrp(fd int, pid int) error {
    21  	return Ioctl(fd, unix.TIOCSPGRP, uintptr(unsafe.Pointer(&pid)))
    22  }