mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-04 10:57:50 +08:00
25 lines
308 B
Go
25 lines
308 B
Go
package sys
|
|
|
|
/*
|
|
#include <unistd.h>
|
|
#include <errno.h>
|
|
|
|
int f(int fd, pid_t pid) {
|
|
return tcsetpgrp(fd, pid);
|
|
}
|
|
|
|
int e() {
|
|
return errno;
|
|
}
|
|
*/
|
|
import "C"
|
|
import "syscall"
|
|
|
|
func Tcsetpgrp(fd int, pid int) error {
|
|
i := C.f(C.int(fd), C.pid_t(pid))
|
|
if i != 0 {
|
|
return syscall.Errno(C.e())
|
|
}
|
|
return nil
|
|
}
|