Skip to content

Helper function bpf_timer_cancel

v5.15

This helper cancels a pending timer.

Definition

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

Cancel the timer and wait for callback_fn to finish if it was running.

Returns

0 if the timer was not active. 1 if the timer was active. -EINVAL if timer was not initialized with bpf_timer_init() earlier. -EDEADLK if callback_fn tried to call bpf_timer_cancel() on its own timer which would have led to a deadlock otherwise.

static long (* const bpf_timer_cancel)(struct bpf_timer *timer) = (void *) 172;

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