sysutil

package
v0.105.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package sysutil contains utilities for functions requiring system calls.

Index

Constants

View Source
const ErrNoStaticIPInfo agherr.Error = "no information about static ip"

ErrNoStaticIPInfo is returned by IfaceHasStaticIP when no information about the IP being static is available.

Variables

This section is empty.

Functions

func CanBindPrivilegedPorts

func CanBindPrivilegedPorts() (can bool, err error)

CanBindPrivilegedPorts checks if current process can bind to privileged ports.

func ConfigureSyslog

func ConfigureSyslog(serviceName string) error

ConfigureSyslog reroutes standard logger output to syslog.

func GatewayIP

func GatewayIP(ifaceName string) net.IP

GatewayIP returns IP address of interface's gateway.

func HaveAdminRights

func HaveAdminRights() (bool, error)

HaveAdminRights checks if the current user has root (administrator) rights.

func IfaceHasStaticIP

func IfaceHasStaticIP(ifaceName string) (has bool, err error)

IfaceHasStaticIP checks if interface is configured to have static IP address. If it can't give a definitive answer, it returns false and an error for which errors.Is(err, ErrNoStaticIPInfo) is true.

func IfaceSetStaticIP

func IfaceSetStaticIP(ifaceName string) (err error)

IfaceSetStaticIP sets static IP address for network interface.

func SendProcessSignal

func SendProcessSignal(pid int, sig syscall.Signal) error

SendProcessSignal sends signal to a process.

func SetRlimit

func SetRlimit(val uint)

SetRlimit sets user-specified limit of how many fd's we can use https://github.com/AdguardTeam/AdGuardHome/internal/issues/659.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL