Hacker News new | past | comments | ask | show | jobs | submit login

Yeah, you understand the code - we all do. But it doesn't tell you anything about the context the code runs in. And its context doesn't tell you about its context either.

Sparse code is not necessarily self-explaining.




The function names do. Honestly, this is very, very simple code. Most of the code in a kernel is nothing more than book keeping or glue connecting things. This is glue.


To expand this is also a really dumb mistake. It's the equivalent of passing user input directly into a SQL query.


There are cues here that are consistent with conventions in the Linux kernel. For example the sys prefix on the function name tells you everything you need to know about "the context the code runs in" - it's a syscall. "compat" gives you a hint that it's a wrapper for another ABI.


"compat" gives you a hint that it's a wrapper for another ABI

Why is this obvious? I can extrapolate on sys, but what cues are in 'compat' that I don't see?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: