linux/tools/include/linux
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
..
sched
unaligned
align.h
args.h selftests/bpf: Add simple strscpy() implementation 2026-02-23 18:40:07 -08:00
arm-smccc.h
atomic.h tools/include: implement a couple of atomic_t ops 2025-09-13 16:55:24 -07:00
bitfield.h tools: Fix bitfield dependency failure 2026-01-28 15:18:44 -03:00
bitmap.h tools: bitmap: add missing bitmap_[subset(), andnot()] 2026-02-12 15:42:57 -08:00
bitops.h
bits.h tools headers: Sync linux/bits.h with the kernel source 2025-08-18 12:38:42 -07:00
btf_ids.h
bug.h
build_bug.h tools headers: Syncronize linux/build_bug.h with the kernel sources 2025-06-16 14:05:11 -03:00
cache.h
cfi_types.h tools headers: kcfi: rename missed CONFIG_CFI_CLANG 2025-10-07 08:21:33 -07:00
compiler-context-analysis.h tools: Update context analysis macros in compiler_types.h 2026-01-28 09:25:45 +01:00
compiler-gcc.h
compiler.h tools headers: Add stub definition for __iomem 2025-08-27 12:14:06 -06:00
compiler_types.h Updates for the VDSO subsystem: 2026-02-10 17:02:23 -08:00
const.h
container_of.h
coresight-pmu.h
ctype.h
debugfs.h
delay.h
err.h
export.h
filter.h
find.h
ftrace.h
gfp.h
gfp_types.h tools headers: Sync linux/gfp_types.h with kernel sources 2025-12-24 11:43:22 -08:00
hash.h
hashtable.h
init.h
interrupt.h
interval_tree_generic.h interval_tree: Fix ITSTATIC usage for *_subtree_search() 2025-10-14 14:45:22 -07:00
io.h tools headers: Import asm-generic MMIO helpers 2025-08-27 12:14:06 -06:00
jhash.h
kallsyms.h kallsyms: fix build without execinfo 2025-07-09 21:07:51 -07:00
kasan-tags.h
kconfig.h
kern_levels.h
kernel.h
linkage.h
list.h tools/lib: Add list_is_first() 2026-01-21 21:54:59 -03:00
list_sort.h
livepatch_external.h objtool/klp: Introduce klp diff subcommand for diffing object files 2025-10-14 14:50:18 -07:00
log2.h
math.h
math64.h
mm.h memblock test: include <linux/sizes.h> from tools mm.h stub 2026-01-05 11:52:48 +02:00
module.h
moduleparam.h
mutex.h
nmi.h
numa.h
objtool_types.h objtool: Add ANNOTATE_DATA_SPECIAL 2025-10-14 14:50:16 -07:00
overflow.h
panic.h
pci_ids.h tools headers: Add symlink to linux/pci_ids.h 2025-08-27 12:14:07 -06:00
pfn.h
poison.h
prandom.h
rbtree.h
rbtree_augmented.h
rcu.h
refcount.h
ring_buffer.h
rwsem.h
seq_file.h
sizes.h
slab.h tools/testing: Add support for prefilled slab sheafs 2025-09-29 09:25:00 +02:00
spinlock.h
static_call_types.h static_call: allow using STATIC_CALL_TRAMP_STR() from assembly 2025-11-15 06:18:17 +00:00
string.h objtool/klp: Introduce klp diff subcommand for diffing object files 2025-10-14 14:50:18 -07:00
stringify.h
time64.h
types.h tools include: Add definitions for __aligned_{l,b}e64 2025-12-23 14:16:18 -07:00
unaligned.h tools headers: Remove unneeded ignoring of warnings in unaligned.h 2026-01-14 08:56:41 +01:00
zalloc.h