Adam Wolk wrote: > Hi tech@, > > Using the GREATSCOTT[1] pattern to output in the ktrace signal handler, > dropping the need for an snprintf and the 8k stack buffer. > > Brought to attention by BlackFrog on #openbsd-daily > > Feedback, OK's?
so mistake in the original: sizeof() includes the nul, which isn't what you want. strlen() is likely to be optimized and gives the correct answer. also, direct write() calls are mostly used in libraries because it can be very bad to get tangled up in stdio, but this is a secondary concern in application code. signal handlers are still a special case, however.