rlimit

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

this is a copied version of https://github.com/cilium/ebpf/blob/main/rlimit/rlimit.go with the following changes: 1. unsupportedMemcgAccounting = &internal.UnsupportedFeatureError replaced with unsupportedMemcgAccounting = errors.New to avoid importing internal package 2. haveMemcgAccounting is initialized once during RemoveMemlock 3. a bunch of internals copied to rlimit/internal/internal_mirror.go

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 eBPF 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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