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  	Prlimit           = prlimit
    15  )
    16  
    17  const (
    18  	Sys_GETEUID = sys_GETEUID
    19  )
    20  
    21  func Tcgetpgrp(fd int) (pgid int32, err error) {
    22  	_, _, errno := Syscall6(SYS_IOCTL, uintptr(fd), uintptr(TIOCGPGRP), uintptr(unsafe.Pointer(&pgid)), 0, 0, 0)
    23  	if errno != 0 {
    24  		return -1, errno
    25  	}
    26  	return pgid, nil
    27  }
    28  
    29  func Tcsetpgrp(fd int, pgid int32) (err error) {
    30  	_, _, errno := Syscall6(SYS_IOCTL, uintptr(fd), uintptr(TIOCSPGRP), uintptr(unsafe.Pointer(&pgid)), 0, 0, 0)
    31  	if errno != 0 {
    32  		return errno
    33  	}
    34  	return nil
    35  }
    36  

View as plain text