kmem_cache_create_usercopy(9)
π kmem_cache_create_usercopy(9) π
okay bestie, welcome to the Kernel API Manual entry for kmem_cache_create_usercopy β it's literally about making a kmem cache with a region suitable for copying to userspace. lowkey essential, highkey iconic β¨
πΈ NAME πΈ
kmem_cache_create_usercopy β create a kmem cache with a region suitable for copying to userspace. periodt π
β¨ SYNOPSIS β¨
struct kmem_cache * kmem_cache_create_usercopy (const char *name ,
unsigned int size , unsigned int align , slab_flags_t flags , unsigned
int useroffset , unsigned int usersize , void (*ctor)(void *) );
π ARGUMENTS π
nameβ a string which is used in/proc/slabinfoto identify this cache. it's giving little name tag for your cache π·οΈsizeβ the size of objects to be created in this cache.alignβ the required alignment for the objects.flagsβ SLAB flags.useroffsetβ Usercopy region offset.usersizeβ Usercopy region size.ctorβ a constructor for the objects, orNULL.
π¦ DESCRIPTION π¦
okay so real talk: this is a legacy wrapper, bestie. new code should use either KMEM_CACHE_USERCOPY if whitelisting a single field is sufficient, or kmem_cache_create with the necessary parameters passed via the args parameter (see struct kmem_cache_args). it's giving "old faithful but not the new hotness" π
π₯ RETURN π₯
a pointer to the cache on success, NULL on failure. that's it, that's the tea β
π SEE ALSO π
the kernel file ./include/linux/slab.h is like the home base, and the whole squad is:
SLAB_HWCACHE_ALIGN(9)SLAB_TYPESAFE_BY_RCU(9)SLAB_ACCOUNT(9)SLAB_RECLAIM_ACCOUNT(9)struct kmem_cache_args(9)kmem_cache_create(9)krealloc_node_align(9)kmem_cache_alloc(9)kmem_cache_charge(9)kmalloc(9)kmalloc_nolock(9)__alloc_objs(9)__alloc_flex(9)kmalloc_obj(9)kmalloc_objs(9)kmalloc_flex(9)kmalloc_array(9)krealloc_array(9)kcalloc(9)kzalloc(9)kvmalloc_node(9)kvrealloc_node_align(9)kmalloc_size_roundup(9)
mwah π this page's source is ./include/linux, it's dated October 2026, and it's the kmem_cache_create_usercopy(9) manual page. bye bestie, go build something iconic π«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms