Source file src/internal/syscall/unix/tcsetpgrp_bsd.go

     1  // Copyright 2024 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 darwin || dragonfly || freebsd || netbsd || openbsd
     6  
     7  package unix
     8  
     9  import (
    10  	"syscall"
    11  	"unsafe"
    12  )
    13  
    14  //go:linkname ioctlPtr syscall.ioctlPtr
    15  func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error)
    16  
    17  // Note that pgid should really be pid_t, however _C_int (aka int32) is
    18  // generally equivalent.
    19  
    20  func Tcsetpgrp(fd int, pgid int32) (err error) {
    21  	return ioctlPtr(fd, syscall.TIOCSPGRP, unsafe.Pointer(&pgid))
    22  }
    23  

View as plain text