Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 2.42 KB

bpf_dynptr_slice_rdwr.md

File metadata and controls

57 lines (43 loc) · 2.42 KB
title description
KFunc 'bpf_dynptr_slice_rdwr'
This page documents the 'bpf_dynptr_slice_rdwr' eBPF kfunc, including its defintion, usage, program types that can use it, and examples.

KFunc bpf_dynptr_slice_rdwr

:octicons-tag-24: v6.4

Get a pointer to dynptr data up to len bytes for read write access.

Definition

If the dynptr doesn't have continuous data up to len bytes, or the dynptr is read only, return NULL.

#!c void *bpf_dynptr_slice_rdwr(const struct bpf_dynptr_kern *ptr, u32 offset, void *buffer__opt, u32 buffer__szk)

!!! note The pointer returned by the kfunc may be NULL. Hence, it forces the user to do a NULL check on the pointer returned from the kfunc before making use of it (dereferencing or passing to another helper).

Usage

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

Program types

The following program types can make use of this kfunc:

Example

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