Skip to content

Helper function bpf_get_prandom_u32

v4.17

Definition

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

Get a pseudo-random number.

From a security point of view, this helper uses its own pseudo-random internal state, and cannot be used to infer the seed of other random functions in the kernel. However, it is essential to note that the generator used by the helper is not cryptographically secure.

Returns

A random 32-bit unsigned value.

static __u32 (* const bpf_get_prandom_u32)(void) = (void *) 7;

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