On 6 November 2014 21:05, Oleg wrote: > I looked at atexit() and atexitdont() and i don't understand why these > functions are implemented with a static array instead of singly linked > list? > May be somebody with a greater plan9 experience can help me with my > question. > It might have been to avoid malloc in a fairly low-level function (and of something that will never be freed), or just because it was easier and, frankly, atexit let alone atexitdont aren't used that much. I'd be surprised if any use of atexit alone relied on any particular order, which is why your problem hasn't been noticed. The reverse order makes sense and atexit already does that. It's atexitdont that's wrong. The functions are unlikely to be called from any hot-spot. I'd just make atexitdont copy down the entries after the one deleted.