Skip to content

Latest commit

 

History

History
51 lines (32 loc) · 1.67 KB

bpf_sysctl_get_new_value.md

File metadata and controls

51 lines (32 loc) · 1.67 KB
title description
Helper Function 'bpf_sysctl_get_new_value'
This page documents the 'bpf_sysctl_get_new_value' eBPF helper function, including its defintion, usage, program types that can use it, and examples.

Helper function bpf_sysctl_get_new_value

:octicons-tag-24: v5.2

Definition

Copyright (c) 2015 The Libbpf Authors. All rights reserved.

Get new value being written by user space to sysctl (before the actual write happens) and copy it as a string into provided by program buffer buf of size buf_len.

User space may write new value at file position > 0.

The buffer is always NUL terminated, unless it's zero-sized.

Returns

Number of character copied (not including the trailing NUL).

-E2BIG if the buffer wasn't big enough (buf will contain truncated name in this case).

-EINVAL if sysctl is being read.

#!c static long (* const bpf_sysctl_get_new_value)(struct bpf_sysctl *ctx, char *buf, unsigned long buf_len) = (void *) 103;

Usage

!!! example "Docs could be improved" This part of the docs is incomplete, contributions are very welcome

Program types

This helper call can be used in the following program types:

Example

!!! example "Docs could be improved" This part of the docs is incomplete, contributions are very welcome