rlimit

package
v0.0.0-...-a55c778 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package rlimit allows raising RLIMIT_MEMLOCK if necessary for the use of BPF.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveMemlock

func RemoveMemlock() error

RemoveMemlock removes the limit on the amount of memory the current process can lock into RAM, if necessary.

This is not required to load gBPF resources on kernel versions 5.11+ due to the introduction of cgroup-based memory accounting. On such kernels the function is a no-op.

Since the function may change global per-process limits it should be invoked at program start up, in main() or init().

This function exists as a convenience and should only be used when permanently raising RLIMIT_MEMLOCK to infinite is appropriate. Consider invoking prlimit(2) directly with a more reasonable limit if desired.

Requires CAP_SYS_RESOURCE on kernels < 5.11.

Types

This section is empty.

Jump to

Keyboard shortcuts

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