linux/tools/include
Ihor Solodrai 63c49efc98 selftests/bpf: Add simple strscpy() implementation
Replace bpf_strlcpy() in bpf_util.h with a sized_strscpy(), which is a
simplified sized_strscpy() from the kernel (lib/string.c [1]). It:
  * takes a count (destination size) parameter
  * guarantees NULL-termination
  * returns the number of characters copied or -E2BIG

Re-define strscpy macro similar to in-kernel implementation [2]: allow
the count parameter to be optional.

Add #ifdef-s to tools/include/linux/args.h, as they may be defined in
other system headers (for example, __CONCAT in sys/cdefs.h).

Fixup the single existing bpf_strlcpy() call in cgroup_helpers.c

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/string.c?h=v6.19#n113
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/string.h?h=v6.19#n91

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/r/20260223190736.649171-2-ihor.solodrai@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-02-23 18:40:07 -08:00
..
asm tools headers: Import x86 MMIO helper overrides 2025-08-27 12:14:06 -06:00
asm-generic tools headers asm: Sync fls headers header with the kernel sources 2025-11-03 13:35:06 -03:00
generated selftests: vDSO: don't include generated headers for chacha test 2024-09-13 17:28:36 +02:00
io_uring selftests/io_uring: support NO_SQARRAY in miniliburing 2026-01-21 07:55:13 -07:00
linux selftests/bpf: Add simple strscpy() implementation 2026-02-23 18:40:07 -08:00
nolibc tools/nolibc: Add fseek() to stdio.h 2026-01-11 12:47:47 +01:00
perf KVM: selftests: aarch64: Update tools copy of arm_pmuv3.h 2023-12-12 09:46:22 +00:00
tools tools include: add dis-asm-compat.h to handle version differences 2022-08-01 15:29:49 -03:00
trace/events
uapi Performance events changes for v7.0: 2026-02-10 12:00:46 -08:00
vdso tools headers: Update the linux/unaligned.h copy with the kernel sources 2026-01-14 08:56:41 +01:00