AdGuardHome/internal/aghos/os_freebsd.go
Ainar Garipov 9f5a015f42 Pull request: all: imp build tags
Updates #2419.

Squashed commit of the following:

commit e57e6ce56c59d4ef42b1716247fe48a86404179e
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Jun 15 19:37:15 2021 +0300

    all: imp build tags
2021-06-15 19:42:41 +03:00

34 lines
548 B
Go

//go:build freebsd
// +build freebsd
package aghos
import (
"os"
"syscall"
)
func canBindPrivilegedPorts() (can bool, err error) {
return HaveAdminRights()
}
func setRlimit(val uint64) (err error) {
var rlim syscall.Rlimit
rlim.Max = int64(val)
rlim.Cur = int64(val)
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
}
func haveAdminRights() (bool, error) {
return os.Getuid() == 0, nil
}
func sendProcessSignal(pid int, sig syscall.Signal) error {
return syscall.Kill(pid, sig)
}
func isOpenWrt() (ok bool) {
return false
}