On Tue, Jul 12, 2011 at 02:25:09PM +0100, Richard Sandiford wrote:
Sorry, should have included this in my last reply.
Dave Martin dave.martin@linaro.org writes:
Also, remember this whole discussion is just to print a message and exit nicely in the case of someone using a currently incredibly rare function on an old kernel!
I'd say we want to notify the operating environment and/or the user. This may be realised by writing some text to stderr, but that's not useful in the context of GUI environments.
Shouldn't a decent GUI environment be able to catch these kinds of errors and log them though?
Ideally yes. Which is why calling some hook may be better than writing a message to stderr, because messages written to stderr are rarely usefully machine-readable (even if not locale-translated). GUI toolkits may provide such a hook, but in the case of dnyamic linking errors and similar, the GUI toolkit is unlikely to have started up at the time the error occurs.
Anyway, it's out of our scope to solve this here, so long as we're no worse than the de facto behaviour.
One problem with early write()s is that we can't do any locale-specific translation. The message is always going to be in English. That's something that the VSO approach solves for free, because it's then up to libc or the dynamic loader to print a suitable message.
Agreed, although locale-translated messages on stderr, while good for humans, tend to be even less machine-readable.
Cheers ---Dave