Logo
Explore Help
Sign In
TheArchive/restic
1
0
Fork 0
You've already forked restic
mirror of https://github.com/restic/restic.git synced 2025-12-12 08:22:08 +00:00
Code Issues Packages Projects Releases Wiki Activity
Files
0a1ce4f2078701a820befc9011b0726f0abd7f59
restic/internal/ui/termstatus/getpgrp_solaris.go

9 lines
113 B
Go
Raw Normal View History

backend,termstatus: Unify foreground/background detection PR #5358 reintroduced a version of the TIOCGPGRP ioctl call that works on all Unix platforms except Linux, due to a bug/inconsistency in x/sys/unix. This commit fixes that by introducing termstatus.Tcgetpgrp. It also introduces termstatus.Getpgrp and termstatus.Tcsetpgrp to deal with the different signature of unix.Getpgrp in Solaris vs. all other Unix platforms and an int-overflowing constant on AIX, so that some AIX/Solaris-specific code can be removed elsewhere and foreground/background detection is done the same everywhere except on Windows.
2025-09-07 12:57:01 +02:00
package termstatus
import "golang.org/x/sys/unix"
func Getpgrp() int {
pid, _ := unix.Getpgrp()
return pid
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 95ms Template: 5ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API