Skip to content

Helper function bpf_sysctl_get_new_value

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.

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

Usage

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

Docs could be improved

This part of the docs is incomplete, contributions are very welcome