create_module(2)

๐Ÿ’– create_module(2) โ€” the girlies' guide to a syscall that literally ghosted us ๐Ÿ’€

okay bestie, gather round, because we're talking about create_module from the Linux System Calls Manual โ€” and no cap, this one is a vintage situation. It's giving "found in the back of the closet, still tagged." ๐ŸŽ€


โœจ NAME โœจ

create_module โ€” create a loadable module entry ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <linux/module.h>

[[deprecated]] caddr_t create_module(const char *name, size_t size);
not the [[deprecated]] tag already dragging it before we even start ๐Ÿ’…

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

Note: this system call is present only before Linux 2.6. So if you're on anything modern, it's not showing up to the party. ๐Ÿ™ˆ

create_module() attempts to create a loadable module entry and reserve the kernel memory that will be needed to hold the module. It's literally reserving the VIP section for the module before it even arrives.

This system call requires privilege. No privilege, no entry โ€” the bouncer is checking your CAP_SYS_MODULE and she is not flexible. ๐Ÿ”ฅ


๐Ÿ‘‘ RETURN VALUE ๐Ÿ‘‘

On success, it returns the kernel address at which the module will reside. That's your little "here's where they're sitting" note. ๐Ÿซถ

On error, -1 is returned and errno is set to indicate the error. Classic. Sigh. ๐Ÿ˜ญ


๐Ÿ’… ERRORS ๐Ÿ’…

  • EEXIST โ€” a module by that name already exists. Name already taken, bestie, pick a different one.
  • EFAULT โ€” name is outside the program's accessible address space. The pointer is wandering somewhere it's not allowed. Not on my watch.
  • EINVAL โ€” the requested size is too small even for the module header information. Like, babe, that's not enough room for the front matter.
  • ENOMEM โ€” the kernel could not allocate a contiguous block of memory large enough for the module. The kernel looked at your request and said "no contiguous blocks, sorry."
  • ENOSYS โ€” create_module() is not supported in this version of the kernel (e.g., Linux 2.6 or later). It simply does not exist here. Ghosted. Blocked. ๐Ÿ’€
  • EPERM โ€” the caller was not privileged (did not have the CAP_SYS_MODULE capability). You didn't have the pass, so you didn't get in.

๐ŸŒˆ STANDARDS ๐ŸŒˆ

Linux. That's it, that's the standard. ๐Ÿงš


โญ HISTORY โญ

Removed in Linux 2.6. Gone. Retired. It went out on top.

This obsolete system call is not supported by glibc. There's no declaration provided in glibc headers โ€” but through a quirk of history, glibc versions before glibc 2.23 did export an ABI for this system call. The way that ancient glibc was out here holding the door open for a syscall that already leftโ€ฆ ๐Ÿ˜ญ

So, in order to employ this system call, it was sufficient to manually declare the interface in your code. Alternatively, you could invoke the system call using syscall(2). Two paths, both vintage, both a little bit feral. ๐Ÿ“


๐Ÿ’– SEE ALSO ๐Ÿ’–


and that's the whole page, bestie!! every last flag, error, and historical footnote accounted for. no details were harmed in the making of this rewrite โœจ

signing off with the receipts: this little relic lives in Linux man-pages 6.20, dated 2025-05-17 โ€” a manual page about a syscall removed in 2.6, still serving looks in 2025. iconic, honestly. ๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: GPL-1.0-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms