| So for the record, I wrote this four years ago. No idea why this is being linked to from here now. Let the record show, also, that I in no way stand by this as being a sane approach. I just walked through it, trying to answer the question. I wanted to show the path to syscall and it was way wackier than I thought it would be. That's why it ended up a blog entry. (Though when my blog went down one day, someone copied the content into the answer: http://stackoverflow.com/revisions/2444508/3 ...and they did so ignoring the license clause difference that my blog is CC-BY-NC-SA instead of CC-BY-SA. There's been a bit of a tussle over that distinction lately, with people selling StackOverflow books: http://meta.stackoverflow.com/questions/272768/is-this-site-... ...and I'll leave it to those with more interest in the issue to decide if that is worth worrying about, because I don't actually care.) Anyway, I'm sure the people involved in writing this had their reasons for doing it this way, and it had to do with code legacy and evolution. I don't want anyone to mistake my trace through it as endorsement. It's just what it is. |
Search for register_printf_function, and realize that printf is now a function that can have whatever side-effects you like (which really sucks for optimization around logging code)