bpf_dynptr_copy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

Okay so we're in the Kernel API Manual, section 9, and today's main character is bpf_dynptr_copy β€” it copies data from one dynptr to another. That's it. That's the whole vibe. A dynptr-to-dynptr copy, no cap 🫢


✨ SYNOPSIS ✨

__bpf_kfunc int bpf_dynptr_copy (const struct bpf_dynptr *dst_ptr , u64
dst_off , const struct bpf_dynptr *src_ptr , u64 src_off , u64 size );

πŸŽ€ ARGUMENTS πŸŽ€

  • dst_ptr β€” the destination dynptr, aka where the data is gonna land πŸ’…
  • dst_off β€” the offset into that destination dynptr 🎯
  • src_ptr β€” the source dynptr, aka where the data is coming from ✨
  • src_off β€” the offset into the source dynptr πŸ“
  • size β€” how much data we're copying from source to destination, in length terms πŸ“

🌸 DESCRIPTION 🌸

So what it does is literally just copy data from the source dynptr over to the destination dynptr. That's the whole job. And the tea on the return value: it hands back 0 on success, or a negative error otherwise 😭 so like, check your return values, bestie, fr fr.


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./kernel/bpf/helpers.c, plus the whole squad: bpf_obj_new(9), bpf_percpu_obj_new(9), bpf_obj_drop(9), bpf_percpu_obj_drop(9), bpf_refcount_acquire(9), bpf_list_push_front(9), bpf_list_push_back(9), bpf_rbtree_add(9), bpf_task_acquire(9), bpf_task_release(9), bpf_cgroup_acquire(9), bpf_cgroup_release(9), bpf_cgroup_ancestor(9), bpf_cgroup_from_id(9), bpf_task_under_cgroup(9), bpf_task_get_cgroup1(9), bpf_task_from_pid(9), bpf_task_from_vpid(9), bpf_dynptr_slice(9), bpf_dynptr_slice_rdwr(9), bpf_dynptr_memset(9), bpf_iter_bits_new(9), bpf_iter_bits_next(9), bpf_iter_bits_destroy(9), bpf_copy_from_user_str(9), bpf_copy_from_user_task_str(9), bpf_strcmp(9), bpf_strcasecmp(9), bpf_strnchr(9), bpf_strchr(9), bpf_strchrnul(9), bpf_strrchr(9), bpf_strnlen(9), bpf_strlen(9), bpf_strspn(9), bpf_strcspn(9), bpf_strstr(9), bpf_strcasestr(9), bpf_strnstr(9), bpf_strncasestr(9), bpf_lookup_user_key(9), bpf_lookup_system_key(9), bpf_key_put(9), bpf_verify_pkcs7_signature(9), bpf_task_work_schedule_signal(9), bpf_task_work_schedule_resume(9), bpf_timer_cancel_async(9). Go read them, iykyk πŸ‘‘


That's the whole page, bestie β€” it lives under ./kernel/bpf and it's dated October 2026 🌈 mwah, go copy some dynptr data responsibly πŸ’œ

πŸ“¦ where this page comes from