|
|
Log in / Subscribe / Register

Anatomy of a system call, part 1

Anatomy of a system call, part 1

Posted Jul 16, 2014 17:03 UTC (Wed) by nix (subscriber, #2304)
In reply to: Anatomy of a system call, part 1 by drysdale
Parent article: Anatomy of a system call, part 1

Quite. Keeping the args on the stack is a non-starter: userspace stacks are swappable, and you *don't* want to have to go checking to see if the args have been swapped out in the instant of ring transition: it's the sort of terribly narrow race that leads to code that rots and then silently breaks in almost-impossible-to-debug ways, and for almost no gain.

But obviously the args have to end up on the stack -- or, rather, have to end up whereever the C ABI for the platform says they should (possibly optimized by asmlinkage, but still, something the compiler supports).

Thanks for this article: I too have wasted entirely too much time tracking this down in pieces now and then: it's nice to have a reference here for next time. Looking forward to the next one.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds