linux

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package linux contains OS specific wrappers around package unix.

Index

Constants

This section is empty.

Variables

View Source
var KernelVersion = sync.OnceValues(detectKernelVersion)

KernelVersion returns the version of the currently running kernel.

Functions

func FSType

func FSType(path string) (int64, error)

func FindKConfig

func FindKConfig() (*os.File, error)

FindKConfig searches for a kconfig file on the host.

It first reads from /boot/config- of the current running kernel and tries /proc/config.gz if nothing was found in /boot. If none of the file provide a kconfig, it returns an error.

func KernelRelease

func KernelRelease() (string, error)

KernelRelease returns the release string of the running kernel. Its format depends on the Linux distribution and corresponds to directory names in /lib/modules by convention. Some examples are 5.15.17-1-lts and 4.19.0-16-amd64.

func PlatformPrefix

func PlatformPrefix() string

PlatformPrefix returns the platform-dependent syscall wrapper prefix used by the linux kernel.

Based on https://github.com/golang/go/blob/master/src/go/build/syslist.go and https://github.com/libbpf/libbpf/blob/master/src/libbpf.c#L10047

Types

This section is empty.

Jump to

Keyboard shortcuts

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