according to the man page: "Before calling _exits with msg as an argument, exits calls in reverse order all the functions recorded by atexit."
so i think your result should be f2, f1, f1. On Thu, Nov 6, 2014 at 1:26 PM, erik quanstrom <quans...@quanstro.net> wrote: > On Thu Nov 6 16:07:56 EST 2014, lego12...@yandex.ru wrote: > > Hi, all. > > > > 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. > > perhaps a linked list would make sense, but atexits(2) doesn't say which > order > the functions will be run in. and it doesn't seem like a great idea to > depend on > atexits running things in a particular order. > > - erik > >