Skip to content

Helper function bpf_sysctl_set_new_value

v5.2

Definition

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

Override new value being written by user space to sysctl with value provided by program in buffer buf of size buf_len.

buf should contain a string in same form as provided by user space on sysctl write.

User space may write new value at file position > 0. To override the whole sysctl value file position should be set to zero.

Returns

0 on success.

-E2BIG if the buf_len is too big.

-EINVAL if sysctl is being read.

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

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