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 package unix
6 7 import (
8 "syscall"
9 "unsafe"
10 )
11 12 // Note that pgid should really be pid_t, however _C_int (aka int32) is
13 // generally equivalent.
14 15 func Tcsetpgrp(fd int, pgid int32) (err error) {
16 _, _, errno := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TIOCSPGRP), uintptr(unsafe.Pointer(&pgid)), 0, 0, 0)
17 if errno != 0 {
18 return errno
19 }
20 return nil
21 }
22