Skip to content

Helper function bpf_get_current_comm

v4.2

Definition

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

Copy the comm attribute of the current task into buf of size_of_buf. The comm attribute contains the name of the executable (excluding the path) for the current task. The size_of_buf must be strictly positive. On success, the helper makes sure that the buf is NUL-terminated. On failure, it is filled with zeroes.

Returns

0 on success, or a negative error in case of failure.

static long (* const bpf_get_current_comm)(void *buf, __u32 size_of_buf) = (void *) 16;

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