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

If error codes were instead some kind of exception packaged with ancillary data, you could easily stick a kernel stack in the event payload and get the localization you're discussing that way. The ability to add context is what makes error codes lose so badly to exceptions.



Generating a kernel stacktrace for every syscall error return seems like it would be needlessly wasteful on the return path (not to mention that it would change between kernel releases, and wouldn't be useful to most developers).

A richer error system could be as simple as giving some more information about why a syscall returned -EINVAL (because checking all possible flag bits to see which one is not supported is really not a fun exercise).




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: