clone2(2)
π clone2(2) π
okay bestie, sit down, hydrate, because we're talking about clone2 and __clone2 β the system-call manual, section 2 β and their whole entire job is: create a child process. β¨ That's it. That's the gig. Not me being dramatic, that's literally the NAME section.
πΈ LIBRARY πΈ
Standard C library β that's libc, linked with -lc, as always. π«Ά
β¨ SYNOPSIS β¨
here's the glibc wrapper, look at her:
// glibc wrapper:
int __clone2(typeof(int (void *)) *fn,
void *stack_base, size_t stack_size,
int flags, void *arg, ...
/* pid_t *parent_tid, struct user_desc *tls,
pid_t *child_tid */ );
and here's the raw system call, the unglamorous one:
// System call:
long syscall(SYS_clone2, unsigned long flags, void *stack_base,
int stack_size, /* Size of stack */
int *parent_tid, int *child_tid,
unsigned long tls);
no cap, stack_size in the syscall version is literally commented as /* Size of stack */ right there in the signature, which is giving "we knew you'd ask." π
π¦ DESCRIPTION π¦
so. These interfaces are similar to clone(2) β like, cousins β but for ia64. ia64 girlies only, sorry to everyone else. π
They operate in the same way as clone(2), with one (1) whole exception, and it's about the stack:
stack_basepoints to the lowest address of the child's stack area β like, the bottom-bottom, not the top.stack_sizespecifies the size of the stack pointed to bystack_base.
that's the whole plot twist. the rest? identical to clone(2). periodt. π
π RETURN VALUE π
See clone(2). I'm not repeating myself, she already said it. π
π ERRORS π
See clone(2). same energy, same errors, go read her. π
β STANDARDS β
None.
literally none. not a single one. she's built different and unstandardised. π
π HISTORY π
Linux (ia64). an icon, a legend, and she is the moment. πΈ
π«Ά SEE ALSO π«Ά
that's the whole friend group btw. just the two of them. iykyk. π§
bestie reminder: this is the ia64-flavouredclone(2)and thestack_base/stack_sizesemantics are genuinely different from regularclone(2). do not mix them up, i'm begging. π
this page was brought to you by Linux man-pages 6.20, dated 2026-06-08 β mwah, slay, bye πβ¨π
π¦ 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 1992, Drew Eckhardt <drew@cs.colorado.edu>
- Copyright 2001-2019, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms