Source file src/syscall/export_linux_test.go

     1  // Copyright 2018 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  package syscall
     6  
     7  import (
     8  	"unsafe"
     9  )
    10  
    11  var (
    12  	RawSyscallNoError = rawSyscallNoError
    13  	ForceClone3       = &forceClone3
    14  )
    15  
    16  const (
    17  	Sys_GETEUID = sys_GETEUID
    18  )
    19  
    20  func Tcgetpgrp(fd int) (pgid int32, err error) {
    21  	_, _, errno := Syscall6(SYS_IOCTL, uintptr(fd), uintptr(TIOCGPGRP), uintptr(unsafe.Pointer(&pgid)), 0, 0, 0)
    22  	if errno != 0 {
    23  		return -1, errno
    24  	}
    25  	return pgid, nil
    26  }
    27  
    28  func Tcsetpgrp(fd int, pgid int32) (err error) {
    29  	_, _, errno := Syscall6(SYS_IOCTL, uintptr(fd), uintptr(TIOCSPGRP), uintptr(unsafe.Pointer(&pgid)), 0, 0, 0)
    30  	if errno != 0 {
    31  		return errno
    32  	}
    33  	return nil
    34  }
    35  

View as plain text