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โnameis outside the program's accessible address space. The pointer is wandering somewhere it's not allowed. Not on my watch.EINVALโ the requestedsizeis 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 theCAP_SYS_MODULEcapability). 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 ๐
delete_module(2)โ the breakupinit_module(2)query_module(2)
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
- Copyright 1996, Free Software Foundation, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms