kmem_cache_create_usercopy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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/slabinfo to 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, or NULL.

πŸ¦‹ 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:


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