From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <3600f4a8554d9bc476742f16a142efcf@ladd.quanstro.net> References: <20141106210544.GA20298@localhost> <3600f4a8554d9bc476742f16a142efcf@ladd.quanstro.net> Date: Thu, 6 Nov 2014 13:42:40 -0800 Message-ID: From: Skip Tavakkolian To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a113cd5d66578ca050737939c Subject: Re: [9fans] atexit() & atexitdont() Topicbox-Message-UUID: 245ab2a6-ead9-11e9-9d60-3106f5b1d025 --001a113cd5d66578ca050737939c Content-Type: text/plain; charset=UTF-8 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 wrote: > On Thu Nov 6 16:07:56 EST 2014, lego12239@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 > > --001a113cd5d66578ca050737939c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
according to the man page:

"B= efore 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.



--001a113cd5d66578ca050737939c--